From ef4f1658fea35ee1fe0b8caae67c8d33b51a42dd Mon Sep 17 00:00:00 2001 From: Tim McGilchrist Date: Thu, 29 Aug 2019 07:31:40 +1000 Subject: [PATCH] fixup! Generate Elasticmapreduce support. --- .../elasticmapreduce/lib/addInstanceGroups.ml | 5 +- .../elasticmapreduce/lib/addJobFlowSteps.ml | 5 +- libraries/elasticmapreduce/lib/addTags.ml | 5 +- .../elasticmapreduce/lib/describeCluster.ml | 5 +- .../elasticmapreduce/lib/describeJobFlows.ml | 5 +- .../elasticmapreduce/lib/describeStep.ml | 5 +- .../lib/listBootstrapActions.ml | 5 +- .../elasticmapreduce/lib/listClusters.ml | 5 +- .../lib/listInstanceGroups.ml | 5 +- .../elasticmapreduce/lib/listInstances.ml | 5 +- libraries/elasticmapreduce/lib/listSteps.ml | 5 +- .../lib/modifyInstanceGroups.ml | 5 +- libraries/elasticmapreduce/lib/removeTags.ml | 5 +- libraries/elasticmapreduce/lib/runJobFlow.ml | 5 +- .../lib/setTerminationProtection.ml | 5 +- .../lib/setVisibleToAllUsers.ml | 5 +- .../elasticmapreduce/lib/terminateJobFlows.ml | 5 +- libraries/elasticmapreduce/lib/types.ml | 78 +++++++++++++------ 18 files changed, 107 insertions(+), 56 deletions(-) diff --git a/libraries/elasticmapreduce/lib/addInstanceGroups.ml b/libraries/elasticmapreduce/lib/addInstanceGroups.ml index 6d54defb7..b86673eab 100644 --- a/libraries/elasticmapreduce/lib/addInstanceGroups.ml +++ b/libraries/elasticmapreduce/lib/addInstanceGroups.ml @@ -4,10 +4,11 @@ type input = AddInstanceGroupsInput.t type output = AddInstanceGroupsOutput.t type error = Errors_internal.t let service = "elasticmapreduce" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticmapreduce.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-03-31"]); ("Action", ["AddInstanceGroups"])] (Util.drop_empty diff --git a/libraries/elasticmapreduce/lib/addJobFlowSteps.ml b/libraries/elasticmapreduce/lib/addJobFlowSteps.ml index 142c1d5dd..17618aabf 100644 --- a/libraries/elasticmapreduce/lib/addJobFlowSteps.ml +++ b/libraries/elasticmapreduce/lib/addJobFlowSteps.ml @@ -4,10 +4,11 @@ type input = AddJobFlowStepsInput.t type output = AddJobFlowStepsOutput.t type error = Errors_internal.t let service = "elasticmapreduce" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticmapreduce.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-03-31"]); ("Action", ["AddJobFlowSteps"])] (Util.drop_empty diff --git a/libraries/elasticmapreduce/lib/addTags.ml b/libraries/elasticmapreduce/lib/addTags.ml index 0122ca5c3..731ec5bc6 100644 --- a/libraries/elasticmapreduce/lib/addTags.ml +++ b/libraries/elasticmapreduce/lib/addTags.ml @@ -4,10 +4,11 @@ type input = AddTagsInput.t type output = unit type error = Errors_internal.t let service = "elasticmapreduce" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticmapreduce.amazonaws.com") + (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 diff --git a/libraries/elasticmapreduce/lib/describeCluster.ml b/libraries/elasticmapreduce/lib/describeCluster.ml index a9a8a9b56..3740b91f1 100644 --- a/libraries/elasticmapreduce/lib/describeCluster.ml +++ b/libraries/elasticmapreduce/lib/describeCluster.ml @@ -4,10 +4,11 @@ type input = DescribeClusterInput.t type output = DescribeClusterOutput.t type error = Errors_internal.t let service = "elasticmapreduce" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticmapreduce.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-03-31"]); ("Action", ["DescribeCluster"])] (Util.drop_empty diff --git a/libraries/elasticmapreduce/lib/describeJobFlows.ml b/libraries/elasticmapreduce/lib/describeJobFlows.ml index 26e818f39..d23e59710 100644 --- a/libraries/elasticmapreduce/lib/describeJobFlows.ml +++ b/libraries/elasticmapreduce/lib/describeJobFlows.ml @@ -4,10 +4,11 @@ type input = DescribeJobFlowsInput.t type output = DescribeJobFlowsOutput.t type error = Errors_internal.t let service = "elasticmapreduce" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticmapreduce.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-03-31"]); ("Action", ["DescribeJobFlows"])] (Util.drop_empty diff --git a/libraries/elasticmapreduce/lib/describeStep.ml b/libraries/elasticmapreduce/lib/describeStep.ml index 30c5b8bee..953a0cffa 100644 --- a/libraries/elasticmapreduce/lib/describeStep.ml +++ b/libraries/elasticmapreduce/lib/describeStep.ml @@ -4,10 +4,11 @@ type input = DescribeStepInput.t type output = DescribeStepOutput.t type error = Errors_internal.t let service = "elasticmapreduce" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticmapreduce.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-03-31"]); ("Action", ["DescribeStep"])] (Util.drop_empty diff --git a/libraries/elasticmapreduce/lib/listBootstrapActions.ml b/libraries/elasticmapreduce/lib/listBootstrapActions.ml index 8556578b2..34cfaf1b8 100644 --- a/libraries/elasticmapreduce/lib/listBootstrapActions.ml +++ b/libraries/elasticmapreduce/lib/listBootstrapActions.ml @@ -4,10 +4,11 @@ type input = ListBootstrapActionsInput.t type output = ListBootstrapActionsOutput.t type error = Errors_internal.t let service = "elasticmapreduce" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticmapreduce.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-03-31"]); ("Action", ["ListBootstrapActions"])] (Util.drop_empty diff --git a/libraries/elasticmapreduce/lib/listClusters.ml b/libraries/elasticmapreduce/lib/listClusters.ml index 1ac3a0d2e..46baea1b7 100644 --- a/libraries/elasticmapreduce/lib/listClusters.ml +++ b/libraries/elasticmapreduce/lib/listClusters.ml @@ -4,10 +4,11 @@ type input = ListClustersInput.t type output = ListClustersOutput.t type error = Errors_internal.t let service = "elasticmapreduce" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticmapreduce.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-03-31"]); ("Action", ["ListClusters"])] (Util.drop_empty diff --git a/libraries/elasticmapreduce/lib/listInstanceGroups.ml b/libraries/elasticmapreduce/lib/listInstanceGroups.ml index 113d64089..995681844 100644 --- a/libraries/elasticmapreduce/lib/listInstanceGroups.ml +++ b/libraries/elasticmapreduce/lib/listInstanceGroups.ml @@ -4,10 +4,11 @@ type input = ListInstanceGroupsInput.t type output = ListInstanceGroupsOutput.t type error = Errors_internal.t let service = "elasticmapreduce" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticmapreduce.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-03-31"]); ("Action", ["ListInstanceGroups"])] (Util.drop_empty diff --git a/libraries/elasticmapreduce/lib/listInstances.ml b/libraries/elasticmapreduce/lib/listInstances.ml index c08473b68..2bfdd7820 100644 --- a/libraries/elasticmapreduce/lib/listInstances.ml +++ b/libraries/elasticmapreduce/lib/listInstances.ml @@ -4,10 +4,11 @@ type input = ListInstancesInput.t type output = ListInstancesOutput.t type error = Errors_internal.t let service = "elasticmapreduce" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticmapreduce.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-03-31"]); ("Action", ["ListInstances"])] (Util.drop_empty diff --git a/libraries/elasticmapreduce/lib/listSteps.ml b/libraries/elasticmapreduce/lib/listSteps.ml index 1f6c6f963..462852bf9 100644 --- a/libraries/elasticmapreduce/lib/listSteps.ml +++ b/libraries/elasticmapreduce/lib/listSteps.ml @@ -4,10 +4,11 @@ type input = ListStepsInput.t type output = ListStepsOutput.t type error = Errors_internal.t let service = "elasticmapreduce" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticmapreduce.amazonaws.com") + (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 diff --git a/libraries/elasticmapreduce/lib/modifyInstanceGroups.ml b/libraries/elasticmapreduce/lib/modifyInstanceGroups.ml index 8e78a7238..944f0f421 100644 --- a/libraries/elasticmapreduce/lib/modifyInstanceGroups.ml +++ b/libraries/elasticmapreduce/lib/modifyInstanceGroups.ml @@ -4,10 +4,11 @@ type input = ModifyInstanceGroupsInput.t type output = unit type error = Errors_internal.t let service = "elasticmapreduce" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticmapreduce.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-03-31"]); ("Action", ["ModifyInstanceGroups"])] (Util.drop_empty diff --git a/libraries/elasticmapreduce/lib/removeTags.ml b/libraries/elasticmapreduce/lib/removeTags.ml index 5b3142ae1..1b64b0008 100644 --- a/libraries/elasticmapreduce/lib/removeTags.ml +++ b/libraries/elasticmapreduce/lib/removeTags.ml @@ -4,10 +4,11 @@ type input = RemoveTagsInput.t type output = unit type error = Errors_internal.t let service = "elasticmapreduce" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticmapreduce.amazonaws.com") + (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 diff --git a/libraries/elasticmapreduce/lib/runJobFlow.ml b/libraries/elasticmapreduce/lib/runJobFlow.ml index ef14605af..fca21a44d 100644 --- a/libraries/elasticmapreduce/lib/runJobFlow.ml +++ b/libraries/elasticmapreduce/lib/runJobFlow.ml @@ -4,10 +4,11 @@ type input = RunJobFlowInput.t type output = RunJobFlowOutput.t type error = Errors_internal.t let service = "elasticmapreduce" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticmapreduce.amazonaws.com") + (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 diff --git a/libraries/elasticmapreduce/lib/setTerminationProtection.ml b/libraries/elasticmapreduce/lib/setTerminationProtection.ml index f1ffb141e..81266be59 100644 --- a/libraries/elasticmapreduce/lib/setTerminationProtection.ml +++ b/libraries/elasticmapreduce/lib/setTerminationProtection.ml @@ -4,10 +4,11 @@ type input = SetTerminationProtectionInput.t type output = unit type error = Errors_internal.t let service = "elasticmapreduce" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticmapreduce.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-03-31"]); ("Action", ["SetTerminationProtection"])] diff --git a/libraries/elasticmapreduce/lib/setVisibleToAllUsers.ml b/libraries/elasticmapreduce/lib/setVisibleToAllUsers.ml index 89ab4586b..8aa76f4d8 100644 --- a/libraries/elasticmapreduce/lib/setVisibleToAllUsers.ml +++ b/libraries/elasticmapreduce/lib/setVisibleToAllUsers.ml @@ -4,10 +4,11 @@ type input = SetVisibleToAllUsersInput.t type output = unit type error = Errors_internal.t let service = "elasticmapreduce" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticmapreduce.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-03-31"]); ("Action", ["SetVisibleToAllUsers"])] (Util.drop_empty diff --git a/libraries/elasticmapreduce/lib/terminateJobFlows.ml b/libraries/elasticmapreduce/lib/terminateJobFlows.ml index 86bd3250c..e9cddc3cb 100644 --- a/libraries/elasticmapreduce/lib/terminateJobFlows.ml +++ b/libraries/elasticmapreduce/lib/terminateJobFlows.ml @@ -4,10 +4,11 @@ type input = TerminateJobFlowsInput.t type output = unit type error = Errors_internal.t let service = "elasticmapreduce" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticmapreduce.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-03-31"]); ("Action", ["TerminateJobFlows"])] (Util.drop_empty diff --git a/libraries/elasticmapreduce/lib/types.ml b/libraries/elasticmapreduce/lib/types.ml index 5396b539d..69b8879c5 100644 --- a/libraries/elasticmapreduce/lib/types.ml +++ b/libraries/elasticmapreduce/lib/types.ml @@ -121,6 +121,8 @@ module InstanceGroupState = (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) @@ -140,6 +142,8 @@ module InstanceRoleType = | 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) @@ -158,6 +162,8 @@ module MarketType = | 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) @@ -186,6 +192,8 @@ module ActionOnFailure = (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) @@ -280,6 +288,8 @@ module StepExecutionState = (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) @@ -296,12 +306,16 @@ module StringMap = 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_query v + 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 -> (k, (String.to_json v)) :: acc) v []) - let of_json j = Json.to_hashtbl String.of_json j + (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 @@ -309,6 +323,8 @@ module StepStateChangeReasonCode = | 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) @@ -337,6 +353,8 @@ module InstanceGroupStateChangeReasonCode = (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) @@ -368,6 +386,8 @@ module InstanceStateChangeReasonCode = (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) @@ -405,6 +425,8 @@ module ClusterStateChangeReasonCode = (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) @@ -791,13 +813,14 @@ module StringList = 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 + 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 = @@ -807,18 +830,19 @@ module rec ConfigurationList : sig 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 + 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 ; @@ -892,6 +916,8 @@ module StepState = (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) @@ -1101,6 +1127,8 @@ module InstanceState = (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) @@ -1227,6 +1255,8 @@ module ClusterState = (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) @@ -1390,6 +1420,8 @@ module JobFlowExecutionState = (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) @@ -1852,6 +1884,8 @@ module InstanceGroupType = | 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)