Source file values.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
(* generated by: awso-codegen generate-all --botocore-data vendor/botocore/botocore/data -o aws --runtime-dir lib/runtime/awso --cli-dir awso-cli *)
open Awso
open! Import
[@@@warning "-32"]
let service = Service.sagemaker_featurestore_runtime
let apiVersion = "2020-07-01"
let endpointPrefix = "featurestore-runtime.sagemaker"
let serviceFullName = "Amazon SageMaker Feature Store Runtime"
let signatureVersion = "v4"
let protocol = "rest_json"
let globalEndpoint = endpointPrefix ^ ".amazonaws.com"
let simple_to_json to_value x =
  Botodata.Json.value_to_json_scalar (to_value x)
let composed_to_json to_value x = Botodata.Json.value_to_json (to_value x)
let to_query to_value x = Client.Query.of_value (to_value x)
let structure_to_value_aux st ~f =
  let filter = function | (k, Some v) -> Some (k, v) | _ -> None in
  let pair k v = (k, v) in
  let defer_value (k, dv) = pair k dv in
  ((List.filter_map st ~f:filter) |> (List.map ~f:defer_value)) |>
    (fun x -> `Structure (f x))
let structure_to_value = structure_to_value_aux ~f:Fn.id
let structure_to_wrapped_value ~wrapper ~response =
  structure_to_value_aux
    ~f:(fun x -> [(wrapper, (`Structure x)); (response, (`Structure []))])
module ValueAsString =
  struct
    type nonrec t = string
    let context_ = "ValueAsString"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:358400) >>=
             (fun () -> check_pattern i ~pattern:".*"));
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"ValueAsString" j
    let to_json = simple_to_json to_value
  end
module FeatureName =
  struct
    type nonrec t = string
    let context_ = "FeatureName"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:64) >>=
                  (fun () ->
                     check_pattern i
                       ~pattern:"^[a-zA-Z0-9]([-_]*[a-zA-Z0-9]){0,63}")));
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"FeatureName" j
    let to_json = simple_to_json to_value
  end
module ValueAsStringList =
  struct
    type nonrec t = ValueAsString.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:358400) >>=
             (fun () -> check_list_min i ~min:0));
        i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:ValueAsString.to_value)) |> (fun x -> `List x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for List_shape objects" ()
    let of_xml x =
      make
        (List.map
           ((Xml.all_children x) |>
              (List.filter
                 ~f:(function
                     | `Data s ->
                         (match Stdlib.String.trim s with
                          | "" -> false
                          | _ -> true)
                     | _ -> true))) ~f:ValueAsString.of_xml)
    let of_json j =
      list_of_json ~kind:"ValueAsStringList" ~of_json:ValueAsString.of_json j
    let to_json v = composed_to_json to_value v
  end
module FeatureValue =
  struct
    type nonrec t =
      {
      featureName: FeatureName.t
        [@ocaml.doc
          "The name of a feature that a feature value corresponds to."];
      valueAsString: ValueAsString.t option
        [@ocaml.doc
          "The value in string format associated with a feature. Used when your CollectionType is None. Note that features types can be String, Integral, or Fractional. This value represents all three types as a string."];
      valueAsStringList: ValueAsStringList.t option
        [@ocaml.doc
          "The list of values in string format associated with a feature. Used when your CollectionType is a List, Set, or Vector. Note that features types can be String, Integral, or Fractional. These values represents all three types as a string."]}
    let context_ = "FeatureValue"
    let make ?valueAsString =
      fun ?valueAsStringList ->
        fun ~featureName ->
          fun () -> { valueAsString; valueAsStringList; featureName }
    let to_value x =
      structure_to_value
        [("FeatureName", (Some (FeatureName.to_value x.featureName)));
        ("ValueAsString",
          (Option.map x.valueAsString ~f:ValueAsString.to_value));
        ("ValueAsStringList",
          (Option.map x.valueAsStringList ~f:ValueAsStringList.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let valueAsStringList =
        (Option.map ~f:ValueAsStringList.of_xml)
          (Xml.child xml_arg0 "ValueAsStringList") in
      let valueAsString =
        (Option.map ~f:ValueAsString.of_xml)
          (Xml.child xml_arg0 "ValueAsString") in
      let featureName =
        FeatureName.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "FeatureName") in
      make ?valueAsStringList ?valueAsString ~featureName ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let valueAsStringList =
        field_map json__ "ValueAsStringList" ValueAsStringList.of_json in
      let valueAsString =
        field_map json__ "ValueAsString" ValueAsString.of_json in
      let featureName =
        field_map_exn json__ "FeatureName" FeatureName.of_json in
      make ?valueAsStringList ?valueAsString ~featureName ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "The value associated with a feature."]
module Message =
  struct
    type nonrec t = string
    let context_ = "Message"
    let make i =
      let open Result in ok_or_failwith (check_string_max i ~max:2048); i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"Message" j
    let to_json = simple_to_json to_value
  end
module ExpiresAt =
  struct
    type nonrec t = string
    let context_ = "ExpiresAt"
    let make i = i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"ExpiresAt" j
    let to_json = simple_to_json to_value
  end
module Record =
  struct
    type nonrec t = FeatureValue.t list
    let make i =
      let open Result in ok_or_failwith (check_list_min i ~min:1); i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:FeatureValue.to_value)) |> (fun x -> `List x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for List_shape objects" ()
    let of_xml x =
      make
        (List.map
           ((Xml.all_children x) |>
              (List.filter
                 ~f:(function
                     | `Data s ->
                         (match Stdlib.String.trim s with
                          | "" -> false
                          | _ -> true)
                     | _ -> true))) ~f:FeatureValue.of_xml)
    let of_json j =
      list_of_json ~kind:"Record" ~of_json:FeatureValue.of_json j
    let to_json v = composed_to_json to_value v
  end
module FeatureGroupNameOrArn =
  struct
    type nonrec t = string
    let context_ = "FeatureGroupNameOrArn"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:150) >>=
                  (fun () ->
                     check_pattern i
                       ~pattern:"(arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:feature-group/)?([a-zA-Z0-9]([-_]*[a-zA-Z0-9]){0,63})")));
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"FeatureGroupNameOrArn" j
    let to_json = simple_to_json to_value
  end
module FeatureNames =
  struct
    type nonrec t = FeatureName.t list
    let make i =
      let open Result in ok_or_failwith (check_list_min i ~min:1); i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:FeatureName.to_value)) |> (fun x -> `List x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for List_shape objects" ()
    let of_xml x =
      make
        (List.map
           ((Xml.all_children x) |>
              (List.filter
                 ~f:(function
                     | `Data s ->
                         (match Stdlib.String.trim s with
                          | "" -> false
                          | _ -> true)
                     | _ -> true))) ~f:FeatureName.of_xml)
    let of_json j =
      list_of_json ~kind:"FeatureNames" ~of_json:FeatureName.of_json j
    let to_json v = composed_to_json to_value v
  end
module RecordIdentifiers =
  struct
    type nonrec t = ValueAsString.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:100) >>=
             (fun () -> check_list_min i ~min:1));
        i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:ValueAsString.to_value)) |> (fun x -> `List x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for List_shape objects" ()
    let of_xml x =
      make
        (List.map
           ((Xml.all_children x) |>
              (List.filter
                 ~f:(function
                     | `Data s ->
                         (match Stdlib.String.trim s with
                          | "" -> false
                          | _ -> true)
                     | _ -> true))) ~f:ValueAsString.of_xml)
    let of_json j =
      list_of_json ~kind:"RecordIdentifiers" ~of_json:ValueAsString.of_json j
    let to_json v = composed_to_json to_value v
  end
module TargetStore =
  struct
    type nonrec t =
      | OnlineStore 
      | OfflineStore 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | OnlineStore -> "OnlineStore"
      | OfflineStore -> "OfflineStore"
      | Non_static_id s -> s
    let of_string =
      function
      | "OnlineStore" -> OnlineStore
      | "OfflineStore" -> OfflineStore
      | x -> Non_static_id x
    let to_value x = `Enum (to_string x)
    let to_query v = to_query to_value v
    let to_header x = to_string x
    let of_xml xml_arg0 =
      of_string (string_of_xml ~kind:"enumeration TargetStore" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"TargetStore" j)
    let to_json = simple_to_json to_value
  end
module TtlDurationUnit =
  struct
    type nonrec t =
      | Seconds 
      | Minutes 
      | Hours 
      | Days 
      | Weeks 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | Seconds -> "Seconds"
      | Minutes -> "Minutes"
      | Hours -> "Hours"
      | Days -> "Days"
      | Weeks -> "Weeks"
      | Non_static_id s -> s
    let of_string =
      function
      | "Seconds" -> Seconds
      | "Minutes" -> Minutes
      | "Hours" -> Hours
      | "Days" -> Days
      | "Weeks" -> Weeks
      | x -> Non_static_id x
    let to_value x = `Enum (to_string x)
    let to_query v = to_query to_value v
    let to_header x = to_string x
    let of_xml xml_arg0 =
      of_string (string_of_xml ~kind:"enumeration TtlDurationUnit" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"TtlDurationUnit" j)
    let to_json = simple_to_json to_value
  end
module TtlDurationValue =
  struct
    type nonrec t = int
    let make i =
      let open Result in ok_or_failwith (check_int_min i ~min:1); i
    let of_string = Int.of_string
    let to_value x = `Integer x
    let to_query v = to_query to_value v
    let to_header x = Int.to_string x
    let of_xml xml_arg0 =
      Int.of_string
        (string_of_xml ~kind:"an integer for TtlDurationValue" xml_arg0)
    let of_json j = Int.of_float (float_of_json ~kind:"an integer" j)
    let to_json = simple_to_json to_value
  end
module BatchGetRecordError =
  struct
    type nonrec t =
      {
      featureGroupName: ValueAsString.t option
        [@ocaml.doc
          "The name of the feature group that the record belongs to."];
      recordIdentifierValueAsString: ValueAsString.t option
        [@ocaml.doc
          "The value for the RecordIdentifier in string format of a Record from a FeatureGroup that is causing an error when attempting to be retrieved."];
      errorCode: ValueAsString.t option
        [@ocaml.doc
          "The error code of an error that has occurred when attempting to retrieve a batch of Records. For more information on errors, see Errors."];
      errorMessage: Message.t option
        [@ocaml.doc
          "The error message of an error that has occurred when attempting to retrieve a record in the batch."]}
    let make ?featureGroupName =
      fun ?recordIdentifierValueAsString ->
        fun ?errorCode ->
          fun ?errorMessage ->
            fun () ->
              {
                featureGroupName;
                recordIdentifierValueAsString;
                errorCode;
                errorMessage
              }
    let to_value x =
      structure_to_value
        [("FeatureGroupName",
           (Option.map x.featureGroupName ~f:ValueAsString.to_value));
        ("RecordIdentifierValueAsString",
          (Option.map x.recordIdentifierValueAsString
             ~f:ValueAsString.to_value));
        ("ErrorCode", (Option.map x.errorCode ~f:ValueAsString.to_value));
        ("ErrorMessage", (Option.map x.errorMessage ~f:Message.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let errorMessage =
        (Option.map ~f:Message.of_xml) (Xml.child xml_arg0 "ErrorMessage") in
      let errorCode =
        (Option.map ~f:ValueAsString.of_xml) (Xml.child xml_arg0 "ErrorCode") in
      let recordIdentifierValueAsString =
        (Option.map ~f:ValueAsString.of_xml)
          (Xml.child xml_arg0 "RecordIdentifierValueAsString") in
      let featureGroupName =
        (Option.map ~f:ValueAsString.of_xml)
          (Xml.child xml_arg0 "FeatureGroupName") in
      make ?errorMessage ?errorCode ?recordIdentifierValueAsString
        ?featureGroupName ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let errorMessage = field_map json__ "ErrorMessage" Message.of_json in
      let errorCode = field_map json__ "ErrorCode" ValueAsString.of_json in
      let recordIdentifierValueAsString =
        field_map json__ "RecordIdentifierValueAsString"
          ValueAsString.of_json in
      let featureGroupName =
        field_map json__ "FeatureGroupName" ValueAsString.of_json in
      make ?errorMessage ?errorCode ?recordIdentifierValueAsString
        ?featureGroupName ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The error that has occurred when attempting to retrieve a batch of Records."]
module BatchGetRecordResultDetail =
  struct
    type nonrec t =
      {
      featureGroupName: ValueAsString.t option
        [@ocaml.doc
          "The FeatureGroupName containing Records you retrieved in a batch."];
      recordIdentifierValueAsString: ValueAsString.t option
        [@ocaml.doc "The value of the record identifier in string format."];
      record: Record.t option [@ocaml.doc "The Record retrieved."];
      expiresAt: ExpiresAt.t option
        [@ocaml.doc "The ExpiresAt ISO string of the requested record."]}
    let make ?featureGroupName =
      fun ?recordIdentifierValueAsString ->
        fun ?record ->
          fun ?expiresAt ->
            fun () ->
              {
                featureGroupName;
                recordIdentifierValueAsString;
                record;
                expiresAt
              }
    let to_value x =
      structure_to_value
        [("FeatureGroupName",
           (Option.map x.featureGroupName ~f:ValueAsString.to_value));
        ("RecordIdentifierValueAsString",
          (Option.map x.recordIdentifierValueAsString
             ~f:ValueAsString.to_value));
        ("Record", (Option.map x.record ~f:Record.to_value));
        ("ExpiresAt", (Option.map x.expiresAt ~f:ExpiresAt.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let expiresAt =
        (Option.map ~f:ExpiresAt.of_xml) (Xml.child xml_arg0 "ExpiresAt") in
      let record =
        (Option.map ~f:Record.of_xml) (Xml.child xml_arg0 "Record") in
      let recordIdentifierValueAsString =
        (Option.map ~f:ValueAsString.of_xml)
          (Xml.child xml_arg0 "RecordIdentifierValueAsString") in
      let featureGroupName =
        (Option.map ~f:ValueAsString.of_xml)
          (Xml.child xml_arg0 "FeatureGroupName") in
      make ?expiresAt ?record ?recordIdentifierValueAsString
        ?featureGroupName ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let expiresAt = field_map json__ "ExpiresAt" ExpiresAt.of_json in
      let record = field_map json__ "Record" Record.of_json in
      let recordIdentifierValueAsString =
        field_map json__ "RecordIdentifierValueAsString"
          ValueAsString.of_json in
      let featureGroupName =
        field_map json__ "FeatureGroupName" ValueAsString.of_json in
      make ?expiresAt ?record ?recordIdentifierValueAsString
        ?featureGroupName ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The output of records that have been retrieved in a batch."]
module BatchGetRecordIdentifier =
  struct
    type nonrec t =
      {
      featureGroupName: FeatureGroupNameOrArn.t
        [@ocaml.doc
          "The name or Amazon Resource Name (ARN) of the FeatureGroup containing the records you are retrieving in a batch."];
      recordIdentifiersValueAsString: RecordIdentifiers.t
        [@ocaml.doc
          "The value for a list of record identifiers in string format."];
      featureNames: FeatureNames.t option
        [@ocaml.doc
          "List of names of Features to be retrieved. If not specified, the latest value for all the Features are returned."]}
    let context_ = "BatchGetRecordIdentifier"
    let make ?featureNames =
      fun ~featureGroupName ->
        fun ~recordIdentifiersValueAsString ->
          fun () ->
            { featureNames; featureGroupName; recordIdentifiersValueAsString
            }
    let to_value x =
      structure_to_value
        [("FeatureGroupName",
           (Some (FeatureGroupNameOrArn.to_value x.featureGroupName)));
        ("RecordIdentifiersValueAsString",
          (Some (RecordIdentifiers.to_value x.recordIdentifiersValueAsString)));
        ("FeatureNames",
          (Option.map x.featureNames ~f:FeatureNames.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let featureNames =
        (Option.map ~f:FeatureNames.of_xml)
          (Xml.child xml_arg0 "FeatureNames") in
      let recordIdentifiersValueAsString =
        RecordIdentifiers.of_xml
          (Xml.child_exn ~context:context_ xml_arg0
             "RecordIdentifiersValueAsString") in
      let featureGroupName =
        FeatureGroupNameOrArn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "FeatureGroupName") in
      make ?featureNames ~recordIdentifiersValueAsString ~featureGroupName ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let featureNames = field_map json__ "FeatureNames" FeatureNames.of_json in
      let recordIdentifiersValueAsString =
        field_map_exn json__ "RecordIdentifiersValueAsString"
          RecordIdentifiers.of_json in
      let featureGroupName =
        field_map_exn json__ "FeatureGroupName" FeatureGroupNameOrArn.of_json in
      make ?featureNames ~recordIdentifiersValueAsString ~featureGroupName ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The identifier that identifies the batch of Records you are retrieving in a batch."]
module TargetStores =
  struct
    type nonrec t = TargetStore.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:2) >>= (fun () -> check_list_min i ~min:1));
        i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:TargetStore.to_value)) |> (fun x -> `List x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for List_shape objects" ()
    let of_xml x =
      make
        (List.map
           ((Xml.all_children x) |>
              (List.filter
                 ~f:(function
                     | `Data s ->
                         (match Stdlib.String.trim s with
                          | "" -> false
                          | _ -> true)
                     | _ -> true))) ~f:TargetStore.of_xml)
    let of_json j =
      list_of_json ~kind:"TargetStores" ~of_json:TargetStore.of_json j
    let to_json v = composed_to_json to_value v
  end
module TtlDuration =
  struct
    type nonrec t =
      {
      unit: TtlDurationUnit.t [@ocaml.doc "TtlDuration time unit."];
      value: TtlDurationValue.t [@ocaml.doc "TtlDuration time value."]}
    let context_ = "TtlDuration"
    let make ~unit = fun ~value -> fun () -> { unit; value }
    let to_value x =
      structure_to_value
        [("Unit", (Some (TtlDurationUnit.to_value x.unit)));
        ("Value", (Some (TtlDurationValue.to_value x.value)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let value =
        TtlDurationValue.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "Value") in
      let unit =
        TtlDurationUnit.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "Unit") in
      make ~value ~unit ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let value = field_map_exn json__ "Value" TtlDurationValue.of_json in
      let unit = field_map_exn json__ "Unit" TtlDurationUnit.of_json in
      make ~value ~unit ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Time to live duration, where the record is hard deleted after the expiration time is reached; ExpiresAt = EventTime + TtlDuration. For information on HardDelete, see the DeleteRecord API in the Amazon SageMaker API Reference guide."]
module AccessForbidden =
  struct
    type nonrec t = {
      message: Message.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("Message", (Option.map x.message ~f:Message.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:Message.of_xml) (Xml.child xml_arg0 "Message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "Message" Message.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "You do not have permission to perform an action."]
module InternalFailure =
  struct
    type nonrec t = {
      message: Message.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("Message", (Option.map x.message ~f:Message.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:Message.of_xml) (Xml.child xml_arg0 "Message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "Message" Message.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support."]
module ResourceNotFound =
  struct
    type nonrec t = {
      message: Message.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("Message", (Option.map x.message ~f:Message.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:Message.of_xml) (Xml.child xml_arg0 "Message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "Message" Message.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "A resource that is required to perform an action was not found."]
module ServiceUnavailable =
  struct
    type nonrec t = {
      message: Message.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("Message", (Option.map x.message ~f:Message.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:Message.of_xml) (Xml.child xml_arg0 "Message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "Message" Message.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "The service is currently unavailable."]
module ValidationError =
  struct
    type nonrec t = {
      message: Message.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("Message", (Option.map x.message ~f:Message.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:Message.of_xml) (Xml.child xml_arg0 "Message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "Message" Message.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "There was an error validating your request."]
module ExpirationTimeResponse =
  struct
    type nonrec t =
      | Enabled 
      | Disabled 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | Enabled -> "Enabled"
      | Disabled -> "Disabled"
      | Non_static_id s -> s
    let of_string =
      function
      | "Enabled" -> Enabled
      | "Disabled" -> Disabled
      | x -> Non_static_id x
    let to_value x = `Enum (to_string x)
    let to_query v = to_query to_value v
    let to_header x = to_string x
    let of_xml xml_arg0 =
      of_string
        (string_of_xml ~kind:"enumeration ExpirationTimeResponse" xml_arg0)
    let of_json j =
      of_string (string_of_json ~kind:"ExpirationTimeResponse" j)
    let to_json = simple_to_json to_value
  end
module DeletionMode =
  struct
    type nonrec t =
      | SoftDelete 
      | HardDelete 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | SoftDelete -> "SoftDelete"
      | HardDelete -> "HardDelete"
      | Non_static_id s -> s
    let of_string =
      function
      | "SoftDelete" -> SoftDelete
      | "HardDelete" -> HardDelete
      | x -> Non_static_id x
    let to_value x = `Enum (to_string x)
    let to_query v = to_query to_value v
    let to_header x = to_string x
    let of_xml xml_arg0 =
      of_string (string_of_xml ~kind:"enumeration DeletionMode" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"DeletionMode" j)
    let to_json = simple_to_json to_value
  end
module BatchGetRecordErrors =
  struct
    type nonrec t = BatchGetRecordError.t list
    let make i =
      let open Result in ok_or_failwith (check_list_min i ~min:0); i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:BatchGetRecordError.to_value)) |>
        (fun x -> `List x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for List_shape objects" ()
    let of_xml x =
      make
        (List.map
           ((Xml.all_children x) |>
              (List.filter
                 ~f:(function
                     | `Data s ->
                         (match Stdlib.String.trim s with
                          | "" -> false
                          | _ -> true)
                     | _ -> true))) ~f:BatchGetRecordError.of_xml)
    let of_json j =
      list_of_json ~kind:"BatchGetRecordErrors"
        ~of_json:BatchGetRecordError.of_json j
    let to_json v = composed_to_json to_value v
  end
module BatchGetRecordResultDetails =
  struct
    type nonrec t = BatchGetRecordResultDetail.t list
    let make i =
      let open Result in ok_or_failwith (check_list_min i ~min:0); i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:BatchGetRecordResultDetail.to_value)) |>
        (fun x -> `List x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for List_shape objects" ()
    let of_xml x =
      make
        (List.map
           ((Xml.all_children x) |>
              (List.filter
                 ~f:(function
                     | `Data s ->
                         (match Stdlib.String.trim s with
                          | "" -> false
                          | _ -> true)
                     | _ -> true))) ~f:BatchGetRecordResultDetail.of_xml)
    let of_json j =
      list_of_json ~kind:"BatchGetRecordResultDetails"
        ~of_json:BatchGetRecordResultDetail.of_json j
    let to_json v = composed_to_json to_value v
  end
module UnprocessedIdentifiers =
  struct
    type nonrec t = BatchGetRecordIdentifier.t list
    let make i =
      let open Result in ok_or_failwith (check_list_min i ~min:0); i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:BatchGetRecordIdentifier.to_value)) |>
        (fun x -> `List x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for List_shape objects" ()
    let of_xml x =
      make
        (List.map
           ((Xml.all_children x) |>
              (List.filter
                 ~f:(function
                     | `Data s ->
                         (match Stdlib.String.trim s with
                          | "" -> false
                          | _ -> true)
                     | _ -> true))) ~f:BatchGetRecordIdentifier.of_xml)
    let of_json j =
      list_of_json ~kind:"UnprocessedIdentifiers"
        ~of_json:BatchGetRecordIdentifier.of_json j
    let to_json v = composed_to_json to_value v
  end
module BatchGetRecordIdentifiers =
  struct
    type nonrec t = BatchGetRecordIdentifier.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:100) >>=
             (fun () -> check_list_min i ~min:1));
        i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:BatchGetRecordIdentifier.to_value)) |>
        (fun x -> `List x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for List_shape objects" ()
    let of_xml x =
      make
        (List.map
           ((Xml.all_children x) |>
              (List.filter
                 ~f:(function
                     | `Data s ->
                         (match Stdlib.String.trim s with
                          | "" -> false
                          | _ -> true)
                     | _ -> true))) ~f:BatchGetRecordIdentifier.of_xml)
    let of_json j =
      list_of_json ~kind:"BatchGetRecordIdentifiers"
        ~of_json:BatchGetRecordIdentifier.of_json j
    let to_json v = composed_to_json to_value v
  end
module PutRecordRequest =
  struct
    type nonrec t =
      {
      featureGroupName: FeatureGroupNameOrArn.t
        [@ocaml.doc
          "The name or Amazon Resource Name (ARN) of the feature group that you want to insert the record into."];
      record: Record.t
        [@ocaml.doc
          "List of FeatureValues to be inserted. This will be a full over-write. If you only want to update few of the feature values, do the following: Use GetRecord to retrieve the latest record. Update the record returned from GetRecord. Use PutRecord to update feature values."];
      targetStores: TargetStores.t option
        [@ocaml.doc
          "A list of stores to which you're adding the record. By default, Feature Store adds the record to all of the stores that you're using for the FeatureGroup."];
      ttlDuration: TtlDuration.t option
        [@ocaml.doc
          "Time to live duration, where the record is hard deleted after the expiration time is reached; ExpiresAt = EventTime + TtlDuration. For information on HardDelete, see the DeleteRecord API in the Amazon SageMaker API Reference guide."]}
    let context_ = "PutRecordRequest"
    let make ?targetStores =
      fun ?ttlDuration ->
        fun ~featureGroupName ->
          fun ~record ->
            fun () -> { targetStores; ttlDuration; featureGroupName; record }
    let to_value x =
      structure_to_value
        [("FeatureGroupName",
           (Some (FeatureGroupNameOrArn.to_value x.featureGroupName)));
        ("Record", (Some (Record.to_value x.record)));
        ("TargetStores",
          (Option.map x.targetStores ~f:TargetStores.to_value));
        ("TtlDuration", (Option.map x.ttlDuration ~f:TtlDuration.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let ttlDuration =
        (Option.map ~f:TtlDuration.of_xml) (Xml.child xml_arg0 "TtlDuration") in
      let targetStores =
        (Option.map ~f:TargetStores.of_xml)
          (Xml.child xml_arg0 "TargetStores") in
      let record =
        Record.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Record") in
      let featureGroupName =
        FeatureGroupNameOrArn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "FeatureGroupName") in
      make ?ttlDuration ?targetStores ~record ~featureGroupName ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let ttlDuration = field_map json__ "TtlDuration" TtlDuration.of_json in
      let targetStores = field_map json__ "TargetStores" TargetStores.of_json in
      let record = field_map_exn json__ "Record" Record.of_json in
      let featureGroupName =
        field_map_exn json__ "FeatureGroupName" FeatureGroupNameOrArn.of_json in
      make ?ttlDuration ?targetStores ~record ~featureGroupName ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The PutRecord API is used to ingest a list of Records into your feature group. If a new record\226\128\153s EventTime is greater, the new record is written to both the OnlineStore and OfflineStore. Otherwise, the record is a historic record and it is written only to the OfflineStore. You can specify the ingestion to be applied to the OnlineStore, OfflineStore, or both by using the TargetStores request parameter. You can set the ingested record to expire at a given time to live (TTL) duration after the record\226\128\153s event time, ExpiresAt = EventTime + TtlDuration, by specifying the TtlDuration parameter. A record level TtlDuration is set when specifying the TtlDuration parameter using the PutRecord API call. If the input TtlDuration is null or unspecified, TtlDuration is set to the default feature group level TtlDuration. A record level TtlDuration supersedes the group level TtlDuration."]
module GetRecordResponse =
  struct
    type nonrec t =
      {
      record: Record.t option
        [@ocaml.doc "The record you requested. A list of FeatureValues."];
      expiresAt: ExpiresAt.t option
        [@ocaml.doc "The ExpiresAt ISO string of the requested record."]}
    type nonrec error =
      [ `AccessForbidden of AccessForbidden.t 
      | `InternalFailure of InternalFailure.t 
      | `ResourceNotFound of ResourceNotFound.t 
      | `ServiceUnavailable of ServiceUnavailable.t 
      | `ValidationError of ValidationError.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?record = fun ?expiresAt -> fun () -> { record; expiresAt }
    let error_of_json name json =
      match name with
      | "AccessForbidden" -> `AccessForbidden (AccessForbidden.of_json json)
      | "InternalFailure" -> `InternalFailure (InternalFailure.of_json json)
      | "ResourceNotFound" ->
          `ResourceNotFound (ResourceNotFound.of_json json)
      | "ServiceUnavailable" ->
          `ServiceUnavailable (ServiceUnavailable.of_json json)
      | "ValidationError" -> `ValidationError (ValidationError.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessForbidden" -> `AccessForbidden (AccessForbidden.of_xml xml)
      | "InternalFailure" -> `InternalFailure (InternalFailure.of_xml xml)
      | "ResourceNotFound" -> `ResourceNotFound (ResourceNotFound.of_xml xml)
      | "ServiceUnavailable" ->
          `ServiceUnavailable (ServiceUnavailable.of_xml xml)
      | "ValidationError" -> `ValidationError (ValidationError.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessForbidden e ->
          `Assoc
            [("error", (`String "AccessForbidden"));
            ("details", (AccessForbidden.to_json e))]
      | `InternalFailure e ->
          `Assoc
            [("error", (`String "InternalFailure"));
            ("details", (InternalFailure.to_json e))]
      | `ResourceNotFound e ->
          `Assoc
            [("error", (`String "ResourceNotFound"));
            ("details", (ResourceNotFound.to_json e))]
      | `ServiceUnavailable e ->
          `Assoc
            [("error", (`String "ServiceUnavailable"));
            ("details", (ServiceUnavailable.to_json e))]
      | `ValidationError e ->
          `Assoc
            [("error", (`String "ValidationError"));
            ("details", (ValidationError.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("Record", (Option.map x.record ~f:Record.to_value));
        ("ExpiresAt", (Option.map x.expiresAt ~f:ExpiresAt.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let expiresAt =
        (Option.map ~f:ExpiresAt.of_xml) (Xml.child xml_arg0 "ExpiresAt") in
      let record =
        (Option.map ~f:Record.of_xml) (Xml.child xml_arg0 "Record") in
      make ?expiresAt ?record ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let expiresAt = field_map json__ "ExpiresAt" ExpiresAt.of_json in
      let record = field_map json__ "Record" Record.of_json in
      make ?expiresAt ?record ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Use for OnlineStore serving from a FeatureStore. Only the latest records stored in the OnlineStore can be retrieved. If no Record with RecordIdentifierValue is found, then an empty result is returned."]
module GetRecordRequest =
  struct
    type nonrec t =
      {
      featureGroupName: FeatureGroupNameOrArn.t
        [@ocaml.doc
          "The name or Amazon Resource Name (ARN) of the feature group from which you want to retrieve a record."];
      recordIdentifierValueAsString: ValueAsString.t
        [@ocaml.doc
          "The value that corresponds to RecordIdentifier type and uniquely identifies the record in the FeatureGroup."];
      featureNames: FeatureNames.t option
        [@ocaml.doc
          "List of names of Features to be retrieved. If not specified, the latest value for all the Features are returned."];
      expirationTimeResponse: ExpirationTimeResponse.t option
        [@ocaml.doc
          "Parameter to request ExpiresAt in response. If Enabled, GetRecord will return the value of ExpiresAt, if it is not null. If Disabled and null, GetRecord will return null."]}
    let context_ = "GetRecordRequest"
    let make ?featureNames =
      fun ?expirationTimeResponse ->
        fun ~featureGroupName ->
          fun ~recordIdentifierValueAsString ->
            fun () ->
              {
                featureNames;
                expirationTimeResponse;
                featureGroupName;
                recordIdentifierValueAsString
              }
    let to_value x =
      structure_to_value
        [("FeatureGroupName",
           (Some (FeatureGroupNameOrArn.to_value x.featureGroupName)));
        ("RecordIdentifierValueAsString",
          (Some (ValueAsString.to_value x.recordIdentifierValueAsString)));
        ("FeatureName", (Option.map x.featureNames ~f:FeatureNames.to_value));
        ("ExpirationTimeResponse",
          (Option.map x.expirationTimeResponse
             ~f:ExpirationTimeResponse.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let expirationTimeResponse =
        (Option.map ~f:ExpirationTimeResponse.of_xml)
          (Xml.child xml_arg0 "ExpirationTimeResponse") in
      let featureNames =
        (Option.map ~f:FeatureNames.of_xml)
          (Xml.child xml_arg0 "FeatureName") in
      let recordIdentifierValueAsString =
        ValueAsString.of_xml
          (Xml.child_exn ~context:context_ xml_arg0
             "RecordIdentifierValueAsString") in
      let featureGroupName =
        FeatureGroupNameOrArn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "FeatureGroupName") in
      make ?expirationTimeResponse ?featureNames
        ~recordIdentifierValueAsString ~featureGroupName ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let expirationTimeResponse =
        field_map json__ "ExpirationTimeResponse"
          ExpirationTimeResponse.of_json in
      let featureNames = field_map json__ "FeatureNames" FeatureNames.of_json in
      let recordIdentifierValueAsString =
        field_map_exn json__ "RecordIdentifierValueAsString"
          ValueAsString.of_json in
      let featureGroupName =
        field_map_exn json__ "FeatureGroupName" FeatureGroupNameOrArn.of_json in
      make ?expirationTimeResponse ?featureNames
        ~recordIdentifierValueAsString ~featureGroupName ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Use for OnlineStore serving from a FeatureStore. Only the latest records stored in the OnlineStore can be retrieved. If no Record with RecordIdentifierValue is found, then an empty result is returned."]
module DeleteRecordRequest =
  struct
    type nonrec t =
      {
      featureGroupName: FeatureGroupNameOrArn.t
        [@ocaml.doc
          "The name or Amazon Resource Name (ARN) of the feature group to delete the record from."];
      recordIdentifierValueAsString: ValueAsString.t
        [@ocaml.doc
          "The value for the RecordIdentifier that uniquely identifies the record, in string format."];
      eventTime: ValueAsString.t
        [@ocaml.doc
          "Timestamp indicating when the deletion event occurred. EventTime can be used to query data at a certain point in time."];
      targetStores: TargetStores.t option
        [@ocaml.doc
          "A list of stores from which you're deleting the record. By default, Feature Store deletes the record from all of the stores that you're using for the FeatureGroup."];
      deletionMode: DeletionMode.t option
        [@ocaml.doc
          "The name of the deletion mode for deleting the record. By default, the deletion mode is set to SoftDelete."]}
    let context_ = "DeleteRecordRequest"
    let make ?targetStores =
      fun ?deletionMode ->
        fun ~featureGroupName ->
          fun ~recordIdentifierValueAsString ->
            fun ~eventTime ->
              fun () ->
                {
                  targetStores;
                  deletionMode;
                  featureGroupName;
                  recordIdentifierValueAsString;
                  eventTime
                }
    let to_value x =
      structure_to_value
        [("FeatureGroupName",
           (Some (FeatureGroupNameOrArn.to_value x.featureGroupName)));
        ("RecordIdentifierValueAsString",
          (Some (ValueAsString.to_value x.recordIdentifierValueAsString)));
        ("EventTime", (Some (ValueAsString.to_value x.eventTime)));
        ("TargetStores",
          (Option.map x.targetStores ~f:TargetStores.to_value));
        ("DeletionMode",
          (Option.map x.deletionMode ~f:DeletionMode.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let deletionMode =
        (Option.map ~f:DeletionMode.of_xml)
          (Xml.child xml_arg0 "DeletionMode") in
      let targetStores =
        (Option.map ~f:TargetStores.of_xml)
          (Xml.child xml_arg0 "TargetStores") in
      let eventTime =
        ValueAsString.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "EventTime") in
      let recordIdentifierValueAsString =
        ValueAsString.of_xml
          (Xml.child_exn ~context:context_ xml_arg0
             "RecordIdentifierValueAsString") in
      let featureGroupName =
        FeatureGroupNameOrArn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "FeatureGroupName") in
      make ?deletionMode ?targetStores ~eventTime
        ~recordIdentifierValueAsString ~featureGroupName ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let deletionMode = field_map json__ "DeletionMode" DeletionMode.of_json in
      let targetStores = field_map json__ "TargetStores" TargetStores.of_json in
      let eventTime = field_map_exn json__ "EventTime" ValueAsString.of_json in
      let recordIdentifierValueAsString =
        field_map_exn json__ "RecordIdentifierValueAsString"
          ValueAsString.of_json in
      let featureGroupName =
        field_map_exn json__ "FeatureGroupName" FeatureGroupNameOrArn.of_json in
      make ?deletionMode ?targetStores ~eventTime
        ~recordIdentifierValueAsString ~featureGroupName ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Deletes a Record from a FeatureGroup in the OnlineStore. Feature Store supports both SoftDelete and HardDelete. For SoftDelete (default), feature columns are set to null and the record is no longer retrievable by GetRecord or BatchGetRecord. For HardDelete, the complete Record is removed from the OnlineStore. In both cases, Feature Store appends the deleted record marker to the OfflineStore. The deleted record marker is a record with the same RecordIdentifer as the original, but with is_deleted value set to True, EventTime set to the delete input EventTime, and other feature values set to null. Note that the EventTime specified in DeleteRecord should be set later than the EventTime of the existing record in the OnlineStore for that RecordIdentifer. If it is not, the deletion does not occur: For SoftDelete, the existing (not deleted) record remains in the OnlineStore, though the delete record marker is still written to the OfflineStore. HardDelete returns EventTime: 400 ValidationException to indicate that the delete operation failed. No delete record marker is written to the OfflineStore. When a record is deleted from the OnlineStore, the deleted record marker is appended to the OfflineStore. If you have the Iceberg table format enabled for your OfflineStore, you can remove all history of a record from the OfflineStore using Amazon Athena or Apache Spark. For information on how to hard delete a record from the OfflineStore with the Iceberg table format enabled, see Delete records from the offline store."]
module BatchGetRecordResponse =
  struct
    type nonrec t =
      {
      records: BatchGetRecordResultDetails.t option
        [@ocaml.doc
          "A list of Records you requested to be retrieved in batch."];
      errors: BatchGetRecordErrors.t option
        [@ocaml.doc
          "A list of errors that have occurred when retrieving a batch of Records."];
      unprocessedIdentifiers: UnprocessedIdentifiers.t option
        [@ocaml.doc
          "A unprocessed list of FeatureGroup names, with their corresponding RecordIdentifier value, and Feature name."]}
    type nonrec error =
      [ `AccessForbidden of AccessForbidden.t 
      | `InternalFailure of InternalFailure.t 
      | `ServiceUnavailable of ServiceUnavailable.t 
      | `ValidationError of ValidationError.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?records =
      fun ?errors ->
        fun ?unprocessedIdentifiers ->
          fun () -> { records; errors; unprocessedIdentifiers }
    let error_of_json name json =
      match name with
      | "AccessForbidden" -> `AccessForbidden (AccessForbidden.of_json json)
      | "InternalFailure" -> `InternalFailure (InternalFailure.of_json json)
      | "ServiceUnavailable" ->
          `ServiceUnavailable (ServiceUnavailable.of_json json)
      | "ValidationError" -> `ValidationError (ValidationError.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessForbidden" -> `AccessForbidden (AccessForbidden.of_xml xml)
      | "InternalFailure" -> `InternalFailure (InternalFailure.of_xml xml)
      | "ServiceUnavailable" ->
          `ServiceUnavailable (ServiceUnavailable.of_xml xml)
      | "ValidationError" -> `ValidationError (ValidationError.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessForbidden e ->
          `Assoc
            [("error", (`String "AccessForbidden"));
            ("details", (AccessForbidden.to_json e))]
      | `InternalFailure e ->
          `Assoc
            [("error", (`String "InternalFailure"));
            ("details", (InternalFailure.to_json e))]
      | `ServiceUnavailable e ->
          `Assoc
            [("error", (`String "ServiceUnavailable"));
            ("details", (ServiceUnavailable.to_json e))]
      | `ValidationError e ->
          `Assoc
            [("error", (`String "ValidationError"));
            ("details", (ValidationError.to_json e))]
      | `Unknown_operation_error (code, msg) ->
          `Assoc (("error", (`String code)) ::
            ((match msg with
              | None -> []
              | Some m -> [("message", (`String m))])))
    let to_value x =
      structure_to_value
        [("Records",
           (Option.map x.records ~f:BatchGetRecordResultDetails.to_value));
        ("Errors", (Option.map x.errors ~f:BatchGetRecordErrors.to_value));
        ("UnprocessedIdentifiers",
          (Option.map x.unprocessedIdentifiers
             ~f:UnprocessedIdentifiers.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let unprocessedIdentifiers =
        (Option.map ~f:UnprocessedIdentifiers.of_xml)
          (Xml.child xml_arg0 "UnprocessedIdentifiers") in
      let errors =
        (Option.map ~f:BatchGetRecordErrors.of_xml)
          (Xml.child xml_arg0 "Errors") in
      let records =
        (Option.map ~f:BatchGetRecordResultDetails.of_xml)
          (Xml.child xml_arg0 "Records") in
      make ?unprocessedIdentifiers ?errors ?records ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let unprocessedIdentifiers =
        field_map json__ "UnprocessedIdentifiers"
          UnprocessedIdentifiers.of_json in
      let errors = field_map json__ "Errors" BatchGetRecordErrors.of_json in
      let records =
        field_map json__ "Records" BatchGetRecordResultDetails.of_json in
      make ?unprocessedIdentifiers ?errors ?records ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Retrieves a batch of Records from a FeatureGroup."]
module BatchGetRecordRequest =
  struct
    type nonrec t =
      {
      identifiers: BatchGetRecordIdentifiers.t
        [@ocaml.doc
          "A list containing the name or Amazon Resource Name (ARN) of the FeatureGroup, the list of names of Features to be retrieved, and the corresponding RecordIdentifier values as strings."];
      expirationTimeResponse: ExpirationTimeResponse.t option
        [@ocaml.doc
          "Parameter to request ExpiresAt in response. If Enabled, BatchGetRecord will return the value of ExpiresAt, if it is not null. If Disabled and null, BatchGetRecord will return null."]}
    let context_ = "BatchGetRecordRequest"
    let make ?expirationTimeResponse =
      fun ~identifiers -> fun () -> { expirationTimeResponse; identifiers }
    let to_value x =
      structure_to_value
        [("Identifiers",
           (Some (BatchGetRecordIdentifiers.to_value x.identifiers)));
        ("ExpirationTimeResponse",
          (Option.map x.expirationTimeResponse
             ~f:ExpirationTimeResponse.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let expirationTimeResponse =
        (Option.map ~f:ExpirationTimeResponse.of_xml)
          (Xml.child xml_arg0 "ExpirationTimeResponse") in
      let identifiers =
        BatchGetRecordIdentifiers.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "Identifiers") in
      make ?expirationTimeResponse ~identifiers ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let expirationTimeResponse =
        field_map json__ "ExpirationTimeResponse"
          ExpirationTimeResponse.of_json in
      let identifiers =
        field_map_exn json__ "Identifiers" BatchGetRecordIdentifiers.of_json in
      make ?expirationTimeResponse ~identifiers ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Retrieves a batch of Records from a FeatureGroup."]