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
(* 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.personalize_events
let apiVersion = "2018-03-22"
let endpointPrefix = "personalize-events"
let serviceFullName = "Amazon Personalize Events"
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 ItemId =
  struct
    type nonrec t = string
    let context_ = "ItemId"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:256) >>=
             (fun () -> check_string_min i ~min:1));
        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:"ItemId" j
    let to_json = simple_to_json to_value
  end
module EventAttributionSource =
  struct
    type nonrec t = string
    let context_ = "EventAttributionSource"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:1024) >>=
             (fun () ->
                check_pattern i
                  ~pattern:"^[\\x20-\\x7E]*[\\x21-\\x7E]+[\\x20-\\x7E]*$"));
        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:"EventAttributionSource" j
    let to_json = simple_to_json to_value
  end
module ActionId =
  struct
    type nonrec t = string
    let context_ = "ActionId"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:256) >>=
             (fun () -> check_string_min i ~min:1));
        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:"ActionId" j
    let to_json = simple_to_json to_value
  end
module StringType =
  struct
    type nonrec t = string
    let context_ = "StringType"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:256) >>=
             (fun () -> check_string_min i ~min:1));
        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:"StringType" j
    let to_json = simple_to_json to_value
  end
module UserProperties =
  struct
    type nonrec t = string
    let context_ = "UserProperties"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:24000) >>=
             (fun () -> check_string_min i ~min:1));
        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:"UserProperties" j
    let to_json = simple_to_json to_value
  end
module ItemProperties =
  struct
    type nonrec t = string
    let context_ = "ItemProperties"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:32000) >>=
             (fun () -> check_string_min i ~min:1));
        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:"ItemProperties" j
    let to_json = simple_to_json to_value
  end
module Date =
  struct
    type nonrec t = string
    let make i = i
    let of_string x = x
    let to_value x = `Timestamp x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = string_of_xml ~kind:"a timestamp"
    let of_json = timestamp_of_json
    let to_json = simple_to_json to_value
  end
module EventPropertiesJSON =
  struct
    type nonrec t = string
    let context_ = "EventPropertiesJSON"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:1024) >>=
             (fun () -> check_string_min i ~min:1));
        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:"EventPropertiesJSON" j
    let to_json = simple_to_json to_value
  end
module FloatType =
  struct
    type nonrec t = float
    let make i = i
    let of_string = Float.of_string
    let to_value x = `Float x
    let to_query v = to_query to_value v
    let to_header x = Stdlib.Float.to_string x
    let of_xml xml_arg0 =
      Float.of_string (string_of_xml ~kind:"a float" xml_arg0)
    let of_json j = float_of_json ~kind:"a float" j
    let to_json = simple_to_json to_value
  end
module Impression =
  struct
    type nonrec t = ItemId.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:25) >>= (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:ItemId.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:ItemId.of_xml)
    let of_json j = list_of_json ~kind:"Impression" ~of_json:ItemId.of_json j
    let to_json v = composed_to_json to_value v
  end
module MetricAttribution =
  struct
    type nonrec t =
      {
      eventAttributionSource: EventAttributionSource.t
        [@ocaml.doc "The source of the event, such as a third party."]}
    let context_ = "MetricAttribution"
    let make ~eventAttributionSource = fun () -> { eventAttributionSource }
    let to_value x =
      structure_to_value
        [("eventAttributionSource",
           (Some (EventAttributionSource.to_value x.eventAttributionSource)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let eventAttributionSource =
        EventAttributionSource.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "eventAttributionSource") in
      make ~eventAttributionSource ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let eventAttributionSource =
        field_map_exn json__ "eventAttributionSource"
          EventAttributionSource.of_json in
      make ~eventAttributionSource ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Contains information about a metric attribution associated with an event. For more information about metric attributions, see Measuring impact of recommendations."]
module RecommendationId =
  struct
    type nonrec t = string
    let context_ = "RecommendationId"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:40) >>=
             (fun () -> check_string_min i ~min:1));
        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:"RecommendationId" j
    let to_json = simple_to_json to_value
  end
module ActionProperties =
  struct
    type nonrec t = string
    let context_ = "ActionProperties"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:32000) >>=
             (fun () -> check_string_min i ~min:1));
        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:"ActionProperties" j
    let to_json = simple_to_json to_value
  end
module ActionImpression =
  struct
    type nonrec t = ActionId.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:25) >>= (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:ActionId.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:ActionId.of_xml)
    let of_json j =
      list_of_json ~kind:"ActionImpression" ~of_json:ActionId.of_json j
    let to_json v = composed_to_json to_value v
  end
module ActionInteractionProperties =
  struct
    type nonrec t = string
    let context_ = "ActionInteractionProperties"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:1024) >>=
             (fun () -> check_string_min i ~min:1));
        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:"ActionInteractionProperties" j
    let to_json = simple_to_json to_value
  end
module UserId =
  struct
    type nonrec t = string
    let context_ = "UserId"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:256) >>=
             (fun () -> check_string_min i ~min:1));
        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:"UserId" j
    let to_json = simple_to_json to_value
  end
module User =
  struct
    type nonrec t =
      {
      userId: StringType.t [@ocaml.doc "The ID associated with the user."];
      properties: UserProperties.t option
        [@ocaml.doc
          "A string map of user-specific metadata. Each element in the map consists of a key-value pair. For example, \\{\"numberOfVideosWatched\": \"45\"\\}. The keys use camel case names that match the fields in the schema for the Users dataset. In the previous example, the numberOfVideosWatched matches the 'NUMBER_OF_VIDEOS_WATCHED' field defined in the Users schema. For categorical string data, to include multiple categories for a single user, separate each category with a pipe separator (|). For example, \\\"Member|Frequent shopper\\\"."]}
    let context_ = "User"
    let make ?properties = fun ~userId -> fun () -> { properties; userId }
    let to_value x =
      structure_to_value
        [("userId", (Some (StringType.to_value x.userId)));
        ("properties", (Option.map x.properties ~f:UserProperties.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let properties =
        (Option.map ~f:UserProperties.of_xml)
          (Xml.child xml_arg0 "properties") in
      let userId =
        StringType.of_xml (Xml.child_exn ~context:context_ xml_arg0 "userId") in
      make ?properties ~userId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let properties = field_map json__ "properties" UserProperties.of_json in
      let userId = field_map_exn json__ "userId" StringType.of_json in
      make ?properties ~userId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Represents user metadata added to a Users dataset using the PutUsers API. For more information see Importing users individually."]
module Item =
  struct
    type nonrec t =
      {
      itemId: StringType.t [@ocaml.doc "The ID associated with the item."];
      properties: ItemProperties.t option
        [@ocaml.doc
          "A string map of item-specific metadata. Each element in the map consists of a key-value pair. For example, \\{\"numberOfRatings\": \"12\"\\}. The keys use camel case names that match the fields in the schema for the Items dataset. In the previous example, the numberOfRatings matches the 'NUMBER_OF_RATINGS' field defined in the Items schema. For categorical string data, to include multiple categories for a single item, separate each category with a pipe separator (|). For example, \\\"Horror|Action\\\"."]}
    let context_ = "Item"
    let make ?properties = fun ~itemId -> fun () -> { properties; itemId }
    let to_value x =
      structure_to_value
        [("itemId", (Some (StringType.to_value x.itemId)));
        ("properties", (Option.map x.properties ~f:ItemProperties.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let properties =
        (Option.map ~f:ItemProperties.of_xml)
          (Xml.child xml_arg0 "properties") in
      let itemId =
        StringType.of_xml (Xml.child_exn ~context:context_ xml_arg0 "itemId") in
      make ?properties ~itemId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let properties = field_map json__ "properties" ItemProperties.of_json in
      let itemId = field_map_exn json__ "itemId" StringType.of_json in
      make ?properties ~itemId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Represents item metadata added to an Items dataset using the PutItems API. For more information see Importing items individually."]
module Event =
  struct
    type nonrec t =
      {
      eventId: StringType.t option
        [@ocaml.doc
          "An ID associated with the event. If an event ID is not provided, Amazon Personalize generates a unique ID for the event. An event ID is not used as an input to the model. Amazon Personalize uses the event ID to distinguish unique events. Any subsequent events after the first with the same event ID are not used in model training."];
      eventType: StringType.t
        [@ocaml.doc
          "The type of event, such as click or download. This property corresponds to the EVENT_TYPE field of your Item interactions dataset's schema and depends on the types of events you are tracking."];
      eventValue: FloatType.t option
        [@ocaml.doc
          "The event value that corresponds to the EVENT_VALUE field of the Item interactions schema."];
      itemId: ItemId.t option
        [@ocaml.doc
          "The item ID key that corresponds to the ITEM_ID field of the Item interactions dataset's schema."];
      properties: EventPropertiesJSON.t option
        [@ocaml.doc
          "A string map of event-specific data that you might choose to record. For example, if a user rates a movie on your site, other than movie ID (itemId) and rating (eventValue) , you might also send the number of movie ratings made by the user. Each item in the map consists of a key-value pair. For example, \\{\"numberOfRatings\": \"12\"\\} The keys use camel case names that match the fields in the Item interactions dataset's schema. In the above example, the numberOfRatings would match the 'NUMBER_OF_RATINGS' field defined in the Item interactions dataset's schema. The following can't be included as a keyword for properties (case insensitive). userId sessionId eventType timestamp recommendationId impression"];
      sentAt: Date.t
        [@ocaml.doc
          "The timestamp (in Unix time) on the client side when the event occurred."];
      recommendationId: RecommendationId.t option
        [@ocaml.doc
          "The ID of the list of recommendations that contains the item the user interacted with. Provide a recommendationId to have Amazon Personalize implicitly record the recommendations you show your user as impressions data. Or provide a recommendationId if you use a metric attribution to measure the impact of recommendations. For more information on recording impressions data, see Recording impressions data. For more information on creating a metric attribution see Measuring impact of recommendations."];
      impression: Impression.t option
        [@ocaml.doc
          "A list of item IDs that represents the sequence of items you have shown the user. For example, \\[\"itemId1\", \"itemId2\", \"itemId3\"\\]. Provide a list of items to manually record impressions data for an event. For more information on recording impressions data, see Recording impressions data."];
      metricAttribution: MetricAttribution.t option
        [@ocaml.doc
          "Contains information about the metric attribution associated with an event. For more information about metric attributions, see Measuring impact of recommendations."]}
    let context_ = "Event"
    let make ?eventId =
      fun ?eventValue ->
        fun ?itemId ->
          fun ?properties ->
            fun ?recommendationId ->
              fun ?impression ->
                fun ?metricAttribution ->
                  fun ~eventType ->
                    fun ~sentAt ->
                      fun () ->
                        {
                          eventId;
                          eventValue;
                          itemId;
                          properties;
                          recommendationId;
                          impression;
                          metricAttribution;
                          eventType;
                          sentAt
                        }
    let to_value x =
      structure_to_value
        [("eventId", (Option.map x.eventId ~f:StringType.to_value));
        ("eventType", (Some (StringType.to_value x.eventType)));
        ("eventValue", (Option.map x.eventValue ~f:FloatType.to_value));
        ("itemId", (Option.map x.itemId ~f:ItemId.to_value));
        ("properties",
          (Option.map x.properties ~f:EventPropertiesJSON.to_value));
        ("sentAt", (Some (Date.to_value x.sentAt)));
        ("recommendationId",
          (Option.map x.recommendationId ~f:RecommendationId.to_value));
        ("impression", (Option.map x.impression ~f:Impression.to_value));
        ("metricAttribution",
          (Option.map x.metricAttribution ~f:MetricAttribution.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let metricAttribution =
        (Option.map ~f:MetricAttribution.of_xml)
          (Xml.child xml_arg0 "metricAttribution") in
      let impression =
        (Option.map ~f:Impression.of_xml) (Xml.child xml_arg0 "impression") in
      let recommendationId =
        (Option.map ~f:RecommendationId.of_xml)
          (Xml.child xml_arg0 "recommendationId") in
      let sentAt =
        Date.of_xml (Xml.child_exn ~context:context_ xml_arg0 "sentAt") in
      let properties =
        (Option.map ~f:EventPropertiesJSON.of_xml)
          (Xml.child xml_arg0 "properties") in
      let itemId =
        (Option.map ~f:ItemId.of_xml) (Xml.child xml_arg0 "itemId") in
      let eventValue =
        (Option.map ~f:FloatType.of_xml) (Xml.child xml_arg0 "eventValue") in
      let eventType =
        StringType.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "eventType") in
      let eventId =
        (Option.map ~f:StringType.of_xml) (Xml.child xml_arg0 "eventId") in
      make ?metricAttribution ?impression ?recommendationId ~sentAt
        ?properties ?itemId ?eventValue ~eventType ?eventId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let metricAttribution =
        field_map json__ "metricAttribution" MetricAttribution.of_json in
      let impression = field_map json__ "impression" Impression.of_json in
      let recommendationId =
        field_map json__ "recommendationId" RecommendationId.of_json in
      let sentAt = field_map_exn json__ "sentAt" Date.of_json in
      let properties =
        field_map json__ "properties" EventPropertiesJSON.of_json in
      let itemId = field_map json__ "itemId" ItemId.of_json in
      let eventValue = field_map json__ "eventValue" FloatType.of_json in
      let eventType = field_map_exn json__ "eventType" StringType.of_json in
      let eventId = field_map json__ "eventId" StringType.of_json in
      make ?metricAttribution ?impression ?recommendationId ~sentAt
        ?properties ?itemId ?eventValue ~eventType ?eventId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Represents item interaction event information sent using the PutEvents API."]
module Action =
  struct
    type nonrec t =
      {
      actionId: StringType.t
        [@ocaml.doc "The ID associated with the action."];
      properties: ActionProperties.t option
        [@ocaml.doc
          "A string map of action-specific metadata. Each element in the map consists of a key-value pair. For example, \\{\"value\": \"100\"\\}. The keys use camel case names that match the fields in the schema for the Actions dataset. In the previous example, the value matches the 'VALUE' field defined in the Actions schema. For categorical string data, to include multiple categories for a single action, separate each category with a pipe separator (|). For example, \\\"Deluxe|Premium\\\"."]}
    let context_ = "Action"
    let make ?properties =
      fun ~actionId -> fun () -> { properties; actionId }
    let to_value x =
      structure_to_value
        [("actionId", (Some (StringType.to_value x.actionId)));
        ("properties",
          (Option.map x.properties ~f:ActionProperties.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let properties =
        (Option.map ~f:ActionProperties.of_xml)
          (Xml.child xml_arg0 "properties") in
      let actionId =
        StringType.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "actionId") in
      make ?properties ~actionId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let properties = field_map json__ "properties" ActionProperties.of_json in
      let actionId = field_map_exn json__ "actionId" StringType.of_json in
      make ?properties ~actionId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Represents action metadata added to an Action dataset using the PutActions API. For more information see Importing actions individually."]
module ActionInteraction =
  struct
    type nonrec t =
      {
      actionId: ActionId.t
        [@ocaml.doc
          "The ID of the action the user interacted with. This corresponds to the ACTION_ID field of the Action interaction schema."];
      userId: UserId.t option
        [@ocaml.doc
          "The ID of the user who interacted with the action. This corresponds to the USER_ID field of the Action interaction schema."];
      sessionId: StringType.t
        [@ocaml.doc
          "The ID associated with the user's visit. Your application generates a unique sessionId when a user first visits your website or uses your application."];
      timestamp: Date.t
        [@ocaml.doc
          "The timestamp for when the action interaction event occurred. Timestamps must be in Unix epoch time format, in seconds."];
      eventType: StringType.t
        [@ocaml.doc
          "The type of action interaction event. You can specify Viewed, Taken, and Not Taken event types. For more information about action interaction event type data, see Event type data."];
      eventId: StringType.t option
        [@ocaml.doc
          "An ID associated with the event. If an event ID is not provided, Amazon Personalize generates a unique ID for the event. An event ID is not used as an input to the model. Amazon Personalize uses the event ID to distinguish unique events. Any subsequent events after the first with the same event ID are not used in model training."];
      recommendationId: RecommendationId.t option
        [@ocaml.doc
          "The ID of the list of recommendations that contains the action the user interacted with."];
      impression: ActionImpression.t option
        [@ocaml.doc
          "A list of action IDs that represents the sequence of actions you have shown the user. For example, \\[\"actionId1\", \"actionId2\", \"actionId3\"\\]. Amazon Personalize doesn't use impressions data from action interaction events. Instead, record multiple events for each action and use the Viewed event type."];
      properties: ActionInteractionProperties.t option
        [@ocaml.doc
          "A string map of event-specific data that you might choose to record. For example, if a user takes an action, other than the action ID, you might also send the number of actions taken by the user. Each item in the map consists of a key-value pair. For example, \\{\"numberOfActions\": \"12\"\\} The keys use camel case names that match the fields in the Action interactions schema. In the above example, the numberOfActions would match the 'NUMBER_OF_ACTIONS' field defined in the Action interactions schema. The following can't be included as a keyword for properties (case insensitive). userId sessionId eventType timestamp recommendationId impression"]}
    let context_ = "ActionInteraction"
    let make ?userId =
      fun ?eventId ->
        fun ?recommendationId ->
          fun ?impression ->
            fun ?properties ->
              fun ~actionId ->
                fun ~sessionId ->
                  fun ~timestamp ->
                    fun ~eventType ->
                      fun () ->
                        {
                          userId;
                          eventId;
                          recommendationId;
                          impression;
                          properties;
                          actionId;
                          sessionId;
                          timestamp;
                          eventType
                        }
    let to_value x =
      structure_to_value
        [("actionId", (Some (ActionId.to_value x.actionId)));
        ("userId", (Option.map x.userId ~f:UserId.to_value));
        ("sessionId", (Some (StringType.to_value x.sessionId)));
        ("timestamp", (Some (Date.to_value x.timestamp)));
        ("eventType", (Some (StringType.to_value x.eventType)));
        ("eventId", (Option.map x.eventId ~f:StringType.to_value));
        ("recommendationId",
          (Option.map x.recommendationId ~f:RecommendationId.to_value));
        ("impression",
          (Option.map x.impression ~f:ActionImpression.to_value));
        ("properties",
          (Option.map x.properties ~f:ActionInteractionProperties.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let properties =
        (Option.map ~f:ActionInteractionProperties.of_xml)
          (Xml.child xml_arg0 "properties") in
      let impression =
        (Option.map ~f:ActionImpression.of_xml)
          (Xml.child xml_arg0 "impression") in
      let recommendationId =
        (Option.map ~f:RecommendationId.of_xml)
          (Xml.child xml_arg0 "recommendationId") in
      let eventId =
        (Option.map ~f:StringType.of_xml) (Xml.child xml_arg0 "eventId") in
      let eventType =
        StringType.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "eventType") in
      let timestamp =
        Date.of_xml (Xml.child_exn ~context:context_ xml_arg0 "timestamp") in
      let sessionId =
        StringType.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "sessionId") in
      let userId =
        (Option.map ~f:UserId.of_xml) (Xml.child xml_arg0 "userId") in
      let actionId =
        ActionId.of_xml (Xml.child_exn ~context:context_ xml_arg0 "actionId") in
      make ?properties ?impression ?recommendationId ?eventId ~eventType
        ~timestamp ~sessionId ?userId ~actionId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let properties =
        field_map json__ "properties" ActionInteractionProperties.of_json in
      let impression = field_map json__ "impression" ActionImpression.of_json in
      let recommendationId =
        field_map json__ "recommendationId" RecommendationId.of_json in
      let eventId = field_map json__ "eventId" StringType.of_json in
      let eventType = field_map_exn json__ "eventType" StringType.of_json in
      let timestamp = field_map_exn json__ "timestamp" Date.of_json in
      let sessionId = field_map_exn json__ "sessionId" StringType.of_json in
      let userId = field_map json__ "userId" UserId.of_json in
      let actionId = field_map_exn json__ "actionId" ActionId.of_json in
      make ?properties ?impression ?recommendationId ?eventId ~eventType
        ~timestamp ~sessionId ?userId ~actionId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Represents an action interaction event sent using the PutActionInteractions API."]
module ErrorMessage =
  struct
    type nonrec t = string
    let context_ = "ErrorMessage"
    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:"ErrorMessage" j
    let to_json = simple_to_json to_value
  end
module Arn =
  struct
    type nonrec t = string
    let context_ = "Arn"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:256) >>=
             (fun () ->
                check_pattern i
                  ~pattern:"arn:([a-z\\d-]+):personalize:.*:.*:.+"));
        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:"Arn" j
    let to_json = simple_to_json to_value
  end
module UserList =
  struct
    type nonrec t = User.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:10) >>= (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:User.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:User.of_xml)
    let of_json j = list_of_json ~kind:"UserList" ~of_json:User.of_json j
    let to_json v = composed_to_json to_value v
  end
module ItemList =
  struct
    type nonrec t = Item.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:10) >>= (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:Item.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:Item.of_xml)
    let of_json j = list_of_json ~kind:"ItemList" ~of_json:Item.of_json j
    let to_json v = composed_to_json to_value v
  end
module EventList =
  struct
    type nonrec t = Event.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:10) >>= (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:Event.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:Event.of_xml)
    let of_json j = list_of_json ~kind:"EventList" ~of_json:Event.of_json j
    let to_json v = composed_to_json to_value v
  end
module ActionList =
  struct
    type nonrec t = Action.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:10) >>= (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:Action.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:Action.of_xml)
    let of_json j = list_of_json ~kind:"ActionList" ~of_json:Action.of_json j
    let to_json v = composed_to_json to_value v
  end
module ActionInteractionsList =
  struct
    type nonrec t = ActionInteraction.t list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:10) >>= (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:ActionInteraction.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:ActionInteraction.of_xml)
    let of_json j =
      list_of_json ~kind:"ActionInteractionsList"
        ~of_json:ActionInteraction.of_json j
    let to_json v = composed_to_json to_value v
  end
module ResourceNotFoundException =
  struct
    type nonrec t = {
      message: ErrorMessage.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:ErrorMessage.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:ErrorMessage.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" ErrorMessage.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Could not find the specified resource."]
module ResourceInUseException =
  struct
    type nonrec t = {
      message: ErrorMessage.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:ErrorMessage.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:ErrorMessage.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" ErrorMessage.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "The specified resource is in use."]
module PutUsersRequest =
  struct
    type nonrec t =
      {
      datasetArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) of the Users dataset you are adding the user or users to."];
      users: UserList.t [@ocaml.doc "A list of user data."]}
    let context_ = "PutUsersRequest"
    let make ~datasetArn = fun ~users -> fun () -> { datasetArn; users }
    let to_value x =
      structure_to_value
        [("datasetArn", (Some (Arn.to_value x.datasetArn)));
        ("users", (Some (UserList.to_value x.users)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let users =
        UserList.of_xml (Xml.child_exn ~context:context_ xml_arg0 "users") in
      let datasetArn =
        Arn.of_xml (Xml.child_exn ~context:context_ xml_arg0 "datasetArn") in
      make ~users ~datasetArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let users = field_map_exn json__ "users" UserList.of_json in
      let datasetArn = field_map_exn json__ "datasetArn" Arn.of_json in
      make ~users ~datasetArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Adds one or more users to a Users dataset. For more information see Importing users individually."]
module PutItemsRequest =
  struct
    type nonrec t =
      {
      datasetArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) of the Items dataset you are adding the item or items to."];
      items: ItemList.t [@ocaml.doc "A list of item data."]}
    let context_ = "PutItemsRequest"
    let make ~datasetArn = fun ~items -> fun () -> { datasetArn; items }
    let to_value x =
      structure_to_value
        [("datasetArn", (Some (Arn.to_value x.datasetArn)));
        ("items", (Some (ItemList.to_value x.items)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let items =
        ItemList.of_xml (Xml.child_exn ~context:context_ xml_arg0 "items") in
      let datasetArn =
        Arn.of_xml (Xml.child_exn ~context:context_ xml_arg0 "datasetArn") in
      make ~items ~datasetArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let items = field_map_exn json__ "items" ItemList.of_json in
      let datasetArn = field_map_exn json__ "datasetArn" Arn.of_json in
      make ~items ~datasetArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Adds one or more items to an Items dataset. For more information see Importing items individually."]
module PutEventsRequest =
  struct
    type nonrec t =
      {
      trackingId: StringType.t
        [@ocaml.doc
          "The tracking ID for the event. The ID is generated by a call to the CreateEventTracker API."];
      userId: UserId.t option
        [@ocaml.doc "The user associated with the event."];
      sessionId: StringType.t
        [@ocaml.doc
          "The session ID associated with the user's visit. Your application generates the sessionId when a user first visits your website or uses your application. Amazon Personalize uses the sessionId to associate events with the user before they log in. For more information, see Recording item interaction events."];
      eventList: EventList.t
        [@ocaml.doc "A list of event data from the session."]}
    let context_ = "PutEventsRequest"
    let make ?userId =
      fun ~trackingId ->
        fun ~sessionId ->
          fun ~eventList ->
            fun () -> { userId; trackingId; sessionId; eventList }
    let to_value x =
      structure_to_value
        [("trackingId", (Some (StringType.to_value x.trackingId)));
        ("userId", (Option.map x.userId ~f:UserId.to_value));
        ("sessionId", (Some (StringType.to_value x.sessionId)));
        ("eventList", (Some (EventList.to_value x.eventList)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let eventList =
        EventList.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "eventList") in
      let sessionId =
        StringType.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "sessionId") in
      let userId =
        (Option.map ~f:UserId.of_xml) (Xml.child xml_arg0 "userId") in
      let trackingId =
        StringType.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "trackingId") in
      make ~eventList ~sessionId ?userId ~trackingId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let eventList = field_map_exn json__ "eventList" EventList.of_json in
      let sessionId = field_map_exn json__ "sessionId" StringType.of_json in
      let userId = field_map json__ "userId" UserId.of_json in
      let trackingId = field_map_exn json__ "trackingId" StringType.of_json in
      make ~eventList ~sessionId ?userId ~trackingId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Records item interaction event data. For more information see Recording item interaction events."]
module PutActionsRequest =
  struct
    type nonrec t =
      {
      datasetArn: Arn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) of the Actions dataset you are adding the action or actions to."];
      actions: ActionList.t [@ocaml.doc "A list of action data."]}
    let context_ = "PutActionsRequest"
    let make ~datasetArn = fun ~actions -> fun () -> { datasetArn; actions }
    let to_value x =
      structure_to_value
        [("datasetArn", (Some (Arn.to_value x.datasetArn)));
        ("actions", (Some (ActionList.to_value x.actions)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let actions =
        ActionList.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "actions") in
      let datasetArn =
        Arn.of_xml (Xml.child_exn ~context:context_ xml_arg0 "datasetArn") in
      make ~actions ~datasetArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let actions = field_map_exn json__ "actions" ActionList.of_json in
      let datasetArn = field_map_exn json__ "datasetArn" Arn.of_json in
      make ~actions ~datasetArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Adds one or more actions to an Actions dataset. For more information see Importing actions individually."]
module PutActionInteractionsRequest =
  struct
    type nonrec t =
      {
      trackingId: StringType.t
        [@ocaml.doc
          "The ID of your action interaction event tracker. When you create an Action interactions dataset, Amazon Personalize creates an action interaction event tracker for you. For more information, see Action interaction event tracker ID."];
      actionInteractions: ActionInteractionsList.t
        [@ocaml.doc "A list of action interaction events from the session."]}
    let context_ = "PutActionInteractionsRequest"
    let make ~trackingId =
      fun ~actionInteractions -> fun () -> { trackingId; actionInteractions }
    let to_value x =
      structure_to_value
        [("trackingId", (Some (StringType.to_value x.trackingId)));
        ("actionInteractions",
          (Some (ActionInteractionsList.to_value x.actionInteractions)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let actionInteractions =
        ActionInteractionsList.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "actionInteractions") in
      let trackingId =
        StringType.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "trackingId") in
      make ~actionInteractions ~trackingId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let actionInteractions =
        field_map_exn json__ "actionInteractions"
          ActionInteractionsList.of_json in
      let trackingId = field_map_exn json__ "trackingId" StringType.of_json in
      make ~actionInteractions ~trackingId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Records action interaction event data. An action interaction event is an interaction between a user and an action. For example, a user taking an action, such a enrolling in a membership program or downloading your app. For more information about recording action interactions, see Recording action interaction events. For more information about actions in an Actions dataset, see Actions dataset."]
module InvalidInputException =
  struct
    type nonrec t = {
      message: ErrorMessage.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:ErrorMessage.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:ErrorMessage.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" ErrorMessage.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Provide a valid value for the field or parameter."]