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
(* 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.bcm_recommended_actions
let apiVersion = "2024-11-14"
let endpointPrefix = "bcm-recommended-actions"
let serviceFullName = "AWS Billing and Cost Management Recommended Actions"
let signatureVersion = "v4"
let protocol = "json"
let globalEndpoint = endpointPrefix ^ ".amazonaws.com"
let targetPrefix = "AWSBillingAndCostManagementRecommendedActions"
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 FilterValue =
  struct
    type nonrec t = string
    let context_ = "FilterValue"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:1024) >>=
                  (fun () -> check_pattern i ~pattern:".*[\\S\\s]*.*")));
        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:"FilterValue" j
    let to_json = simple_to_json to_value
  end
module String_ =
  struct
    type nonrec t = string
    let context_ = "String"
    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:"String" j
    let to_json = simple_to_json to_value
  end
module NextStep =
  struct
    type nonrec t = string
    let context_ = "NextStep"
    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:"NextStep" j
    let to_json = simple_to_json to_value
  end
module FilterName =
  struct
    type nonrec t =
      | FEATURE 
      | SEVERITY 
      | TYPE 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | FEATURE -> "FEATURE"
      | SEVERITY -> "SEVERITY"
      | TYPE -> "TYPE"
      | Non_static_id s -> s
    let of_string =
      function
      | "FEATURE" -> FEATURE
      | "SEVERITY" -> SEVERITY
      | "TYPE" -> TYPE
      | 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 FilterName" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"FilterName" j)
    let to_json = simple_to_json to_value
  end
module FilterValues =
  struct
    type nonrec t = FilterValue.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:FilterValue.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:FilterValue.of_xml)
    let of_json j =
      list_of_json ~kind:"FilterValues" ~of_json:FilterValue.of_json j
    let to_json v = composed_to_json to_value v
  end
module MatchOption =
  struct
    type nonrec t =
      | EQUALS 
      | NOT_EQUALS 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | EQUALS -> "EQUALS"
      | NOT_EQUALS -> "NOT_EQUALS"
      | Non_static_id s -> s
    let of_string =
      function
      | "EQUALS" -> EQUALS
      | "NOT_EQUALS" -> NOT_EQUALS
      | 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 MatchOption" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"MatchOption" j)
    let to_json = simple_to_json to_value
  end
module AccountId =
  struct
    type nonrec t = string
    let context_ = "AccountId"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:12) >>=
             (fun () ->
                (check_string_max i ~max:12) >>=
                  (fun () -> check_pattern i ~pattern:"[0-9]{12}")));
        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:"AccountId" j
    let to_json = simple_to_json to_value
  end
module ActionType =
  struct
    type nonrec t =
      | ADD_ALTERNATE_BILLING_CONTACT 
      | CREATE_ANOMALY_MONITOR 
      | CREATE_BUDGET 
      | ENABLE_COST_OPTIMIZATION_HUB 
      | MIGRATE_TO_GRANULAR_PERMISSIONS 
      | PAYMENTS_DUE 
      | PAYMENTS_PAST_DUE 
      | REVIEW_ANOMALIES 
      | REVIEW_BUDGET_ALERTS 
      | REVIEW_BUDGETS_EXCEEDED 
      | REVIEW_EXPIRING_RI 
      | REVIEW_EXPIRING_SP 
      | REVIEW_FREETIER_USAGE_ALERTS 
      | REVIEW_FREETIER_CREDITS_REMAINING 
      | REVIEW_FREETIER_DAYS_REMAINING 
      | REVIEW_SAVINGS_OPPORTUNITY_RECOMMENDATIONS 
      | UPDATE_EXPIRED_PAYMENT_METHOD 
      | UPDATE_INVALID_PAYMENT_METHOD 
      | UPDATE_TAX_EXEMPTION_CERTIFICATE 
      | UPDATE_TAX_REGISTRATION_NUMBER 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | ADD_ALTERNATE_BILLING_CONTACT -> "ADD_ALTERNATE_BILLING_CONTACT"
      | CREATE_ANOMALY_MONITOR -> "CREATE_ANOMALY_MONITOR"
      | CREATE_BUDGET -> "CREATE_BUDGET"
      | ENABLE_COST_OPTIMIZATION_HUB -> "ENABLE_COST_OPTIMIZATION_HUB"
      | MIGRATE_TO_GRANULAR_PERMISSIONS -> "MIGRATE_TO_GRANULAR_PERMISSIONS"
      | PAYMENTS_DUE -> "PAYMENTS_DUE"
      | PAYMENTS_PAST_DUE -> "PAYMENTS_PAST_DUE"
      | REVIEW_ANOMALIES -> "REVIEW_ANOMALIES"
      | REVIEW_BUDGET_ALERTS -> "REVIEW_BUDGET_ALERTS"
      | REVIEW_BUDGETS_EXCEEDED -> "REVIEW_BUDGETS_EXCEEDED"
      | REVIEW_EXPIRING_RI -> "REVIEW_EXPIRING_RI"
      | REVIEW_EXPIRING_SP -> "REVIEW_EXPIRING_SP"
      | REVIEW_FREETIER_USAGE_ALERTS -> "REVIEW_FREETIER_USAGE_ALERTS"
      | REVIEW_FREETIER_CREDITS_REMAINING ->
          "REVIEW_FREETIER_CREDITS_REMAINING"
      | REVIEW_FREETIER_DAYS_REMAINING -> "REVIEW_FREETIER_DAYS_REMAINING"
      | REVIEW_SAVINGS_OPPORTUNITY_RECOMMENDATIONS ->
          "REVIEW_SAVINGS_OPPORTUNITY_RECOMMENDATIONS"
      | UPDATE_EXPIRED_PAYMENT_METHOD -> "UPDATE_EXPIRED_PAYMENT_METHOD"
      | UPDATE_INVALID_PAYMENT_METHOD -> "UPDATE_INVALID_PAYMENT_METHOD"
      | UPDATE_TAX_EXEMPTION_CERTIFICATE ->
          "UPDATE_TAX_EXEMPTION_CERTIFICATE"
      | UPDATE_TAX_REGISTRATION_NUMBER -> "UPDATE_TAX_REGISTRATION_NUMBER"
      | Non_static_id s -> s
    let of_string =
      function
      | "ADD_ALTERNATE_BILLING_CONTACT" -> ADD_ALTERNATE_BILLING_CONTACT
      | "CREATE_ANOMALY_MONITOR" -> CREATE_ANOMALY_MONITOR
      | "CREATE_BUDGET" -> CREATE_BUDGET
      | "ENABLE_COST_OPTIMIZATION_HUB" -> ENABLE_COST_OPTIMIZATION_HUB
      | "MIGRATE_TO_GRANULAR_PERMISSIONS" -> MIGRATE_TO_GRANULAR_PERMISSIONS
      | "PAYMENTS_DUE" -> PAYMENTS_DUE
      | "PAYMENTS_PAST_DUE" -> PAYMENTS_PAST_DUE
      | "REVIEW_ANOMALIES" -> REVIEW_ANOMALIES
      | "REVIEW_BUDGET_ALERTS" -> REVIEW_BUDGET_ALERTS
      | "REVIEW_BUDGETS_EXCEEDED" -> REVIEW_BUDGETS_EXCEEDED
      | "REVIEW_EXPIRING_RI" -> REVIEW_EXPIRING_RI
      | "REVIEW_EXPIRING_SP" -> REVIEW_EXPIRING_SP
      | "REVIEW_FREETIER_USAGE_ALERTS" -> REVIEW_FREETIER_USAGE_ALERTS
      | "REVIEW_FREETIER_CREDITS_REMAINING" ->
          REVIEW_FREETIER_CREDITS_REMAINING
      | "REVIEW_FREETIER_DAYS_REMAINING" -> REVIEW_FREETIER_DAYS_REMAINING
      | "REVIEW_SAVINGS_OPPORTUNITY_RECOMMENDATIONS" ->
          REVIEW_SAVINGS_OPPORTUNITY_RECOMMENDATIONS
      | "UPDATE_EXPIRED_PAYMENT_METHOD" -> UPDATE_EXPIRED_PAYMENT_METHOD
      | "UPDATE_INVALID_PAYMENT_METHOD" -> UPDATE_INVALID_PAYMENT_METHOD
      | "UPDATE_TAX_EXEMPTION_CERTIFICATE" ->
          UPDATE_TAX_EXEMPTION_CERTIFICATE
      | "UPDATE_TAX_REGISTRATION_NUMBER" -> UPDATE_TAX_REGISTRATION_NUMBER
      | 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 ActionType" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"ActionType" j)
    let to_json = simple_to_json to_value
  end
module Context =
  struct
    type nonrec t = (String_.t * String_.t) list
    let make i = i
    let of_header xs =
      make
        (List.filter_map xs
           ~f:(fun (k, v) ->
                 (Base.String.chop_prefix k ~prefix:"x-amz-meta-") |>
                   (Option.map
                      ~f:(fun chopped ->
                            ((String_.of_string chopped),
                              (String_.of_string v))))))
    let to_value xs =
      (xs |>
         (List.map
            ~f:(fun (x, y) ->
                  (String_.to_value x) |>
                    (fun x -> (String_.to_value y) |> (fun y -> (x, y))))))
        |> (fun x -> `Map x)
    let to_query v = to_query to_value v
    let to_header _ =
      failwithf "to_header is not implemented for Map_shape objects" ()
    let of_xml _ =
      failwith "of_xml_converter_of_shape: Map_shape case not implemented"
    let of_json j =
      object_of_json ~key_of_string:String_.of_string
        ~of_json:String_.of_json j
    let to_json v = composed_to_json to_value v
  end
module Feature =
  struct
    type nonrec t =
      | ACCOUNT 
      | BUDGETS 
      | COST_ANOMALY_DETECTION 
      | COST_OPTIMIZATION_HUB 
      | FREE_TIER 
      | IAM 
      | PAYMENTS 
      | RESERVATIONS 
      | SAVINGS_PLANS 
      | TAX_SETTINGS 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | ACCOUNT -> "ACCOUNT"
      | BUDGETS -> "BUDGETS"
      | COST_ANOMALY_DETECTION -> "COST_ANOMALY_DETECTION"
      | COST_OPTIMIZATION_HUB -> "COST_OPTIMIZATION_HUB"
      | FREE_TIER -> "FREE_TIER"
      | IAM -> "IAM"
      | PAYMENTS -> "PAYMENTS"
      | RESERVATIONS -> "RESERVATIONS"
      | SAVINGS_PLANS -> "SAVINGS_PLANS"
      | TAX_SETTINGS -> "TAX_SETTINGS"
      | Non_static_id s -> s
    let of_string =
      function
      | "ACCOUNT" -> ACCOUNT
      | "BUDGETS" -> BUDGETS
      | "COST_ANOMALY_DETECTION" -> COST_ANOMALY_DETECTION
      | "COST_OPTIMIZATION_HUB" -> COST_OPTIMIZATION_HUB
      | "FREE_TIER" -> FREE_TIER
      | "IAM" -> IAM
      | "PAYMENTS" -> PAYMENTS
      | "RESERVATIONS" -> RESERVATIONS
      | "SAVINGS_PLANS" -> SAVINGS_PLANS
      | "TAX_SETTINGS" -> TAX_SETTINGS
      | 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 Feature" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"Feature" j)
    let to_json = simple_to_json to_value
  end
module NextSteps =
  struct
    type nonrec t = NextStep.t list
    let make i = i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:NextStep.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:NextStep.of_xml)
    let of_json j =
      list_of_json ~kind:"NextSteps" ~of_json:NextStep.of_json j
    let to_json v = composed_to_json to_value v
  end
module Severity =
  struct
    type nonrec t =
      | INFO 
      | WARNING 
      | CRITICAL 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | INFO -> "INFO"
      | WARNING -> "WARNING"
      | CRITICAL -> "CRITICAL"
      | Non_static_id s -> s
    let of_string =
      function
      | "INFO" -> INFO
      | "WARNING" -> WARNING
      | "CRITICAL" -> CRITICAL
      | 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 Severity" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"Severity" j)
    let to_json = simple_to_json to_value
  end
module ValidationExceptionField =
  struct
    type nonrec t =
      {
      name: String_.t option
        [@ocaml.doc "Provides the name of the field that failed validation."];
      message: String_.t option
        [@ocaml.doc
          "Provides a message explaining why the field failed validation."]}
    let make ?name = fun ?message -> fun () -> { name; message }
    let to_value x =
      structure_to_value
        [("name", (Option.map x.name ~f:String_.to_value));
        ("message", (Option.map x.message ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      let name = (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "name") in
      make ?message ?name ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" String_.of_json in
      let name = field_map json__ "name" String_.of_json in
      make ?message ?name ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Provides specific details about why a particular field failed validation."]
module ActionFilter =
  struct
    type nonrec t =
      {
      key: FilterName.t
        [@ocaml.doc
          "The category to filter on. Valid values are FEATURE for feature type, SEVERITY for severity level, and TYPE for recommendation type."];
      matchOption: MatchOption.t
        [@ocaml.doc
          "Specifies how to apply the filter. Use EQUALS to include matching results or NOT_EQUALS to exclude matching results."];
      values: FilterValues.t
        [@ocaml.doc "One or more values to match against the specified key."]}
    let context_ = "ActionFilter"
    let make ~key =
      fun ~matchOption ->
        fun ~values -> fun () -> { key; matchOption; values }
    let to_value x =
      structure_to_value
        [("key", (Some (FilterName.to_value x.key)));
        ("matchOption", (Some (MatchOption.to_value x.matchOption)));
        ("values", (Some (FilterValues.to_value x.values)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let values =
        FilterValues.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "values") in
      let matchOption =
        MatchOption.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "matchOption") in
      let key =
        FilterName.of_xml (Xml.child_exn ~context:context_ xml_arg0 "key") in
      make ~values ~matchOption ~key ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let values = field_map_exn json__ "values" FilterValues.of_json in
      let matchOption =
        field_map_exn json__ "matchOption" MatchOption.of_json in
      let key = field_map_exn json__ "key" FilterName.of_json in
      make ~values ~matchOption ~key ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Describes a filter that returns a more specific list of recommended actions."]
module RecommendedAction =
  struct
    type nonrec t =
      {
      id: String_.t option [@ocaml.doc "The ID for the recommended action."];
      type_: ActionType.t option
        [@ocaml.doc
          "The type of action you can take by adopting the recommended action."];
      accountId: AccountId.t option
        [@ocaml.doc "The account that the recommended action is for."];
      severity: Severity.t option
        [@ocaml.doc "The severity associated with the recommended action."];
      feature: Feature.t option
        [@ocaml.doc "The feature associated with the recommended action."];
      context: Context.t option
        [@ocaml.doc "Context that applies to the recommended action."];
      nextSteps: NextSteps.t option
        [@ocaml.doc
          "The possible next steps to execute the recommended action."];
      lastUpdatedTimeStamp: String_.t option
        [@ocaml.doc
          "The time when the recommended action status was last updated."]}
    let make ?id =
      fun ?type_ ->
        fun ?accountId ->
          fun ?severity ->
            fun ?feature ->
              fun ?context ->
                fun ?nextSteps ->
                  fun ?lastUpdatedTimeStamp ->
                    fun () ->
                      {
                        id;
                        type_;
                        accountId;
                        severity;
                        feature;
                        context;
                        nextSteps;
                        lastUpdatedTimeStamp
                      }
    let to_value x =
      structure_to_value
        [("id", (Option.map x.id ~f:String_.to_value));
        ("type", (Option.map x.type_ ~f:ActionType.to_value));
        ("accountId", (Option.map x.accountId ~f:AccountId.to_value));
        ("severity", (Option.map x.severity ~f:Severity.to_value));
        ("feature", (Option.map x.feature ~f:Feature.to_value));
        ("context", (Option.map x.context ~f:Context.to_value));
        ("nextSteps", (Option.map x.nextSteps ~f:NextSteps.to_value));
        ("lastUpdatedTimeStamp",
          (Option.map x.lastUpdatedTimeStamp ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let lastUpdatedTimeStamp =
        (Option.map ~f:String_.of_xml)
          (Xml.child xml_arg0 "lastUpdatedTimeStamp") in
      let nextSteps =
        (Option.map ~f:NextSteps.of_xml) (Xml.child xml_arg0 "nextSteps") in
      let context =
        (Option.map ~f:Context.of_xml) (Xml.child xml_arg0 "context") in
      let feature =
        (Option.map ~f:Feature.of_xml) (Xml.child xml_arg0 "feature") in
      let severity =
        (Option.map ~f:Severity.of_xml) (Xml.child xml_arg0 "severity") in
      let accountId =
        (Option.map ~f:AccountId.of_xml) (Xml.child xml_arg0 "accountId") in
      let type_ =
        (Option.map ~f:ActionType.of_xml) (Xml.child xml_arg0 "type") in
      let id = (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "id") in
      make ?lastUpdatedTimeStamp ?nextSteps ?context ?feature ?severity
        ?accountId ?type_ ?id ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let lastUpdatedTimeStamp =
        field_map json__ "lastUpdatedTimeStamp" String_.of_json in
      let nextSteps = field_map json__ "nextSteps" NextSteps.of_json in
      let context = field_map json__ "context" Context.of_json in
      let feature = field_map json__ "feature" Feature.of_json in
      let severity = field_map json__ "severity" Severity.of_json in
      let accountId = field_map json__ "accountId" AccountId.of_json in
      let type_ = field_map json__ "type" ActionType.of_json in
      let id = field_map json__ "id" String_.of_json in
      make ?lastUpdatedTimeStamp ?nextSteps ?context ?feature ?severity
        ?accountId ?type_ ?id ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Describes a specific recommended action."]
module ValidationExceptionFieldList =
  struct
    type nonrec t = ValidationExceptionField.t list
    let make i = i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:ValidationExceptionField.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:ValidationExceptionField.of_xml)
    let of_json j =
      list_of_json ~kind:"ValidationExceptionFieldList"
        ~of_json:ValidationExceptionField.of_json j
    let to_json v = composed_to_json to_value v
  end
module ValidationExceptionReason =
  struct
    type nonrec t =
      | UnknownOperation 
      | CannotParse 
      | FieldValidationFailed 
      | Other 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | UnknownOperation -> "unknownOperation"
      | CannotParse -> "cannotParse"
      | FieldValidationFailed -> "fieldValidationFailed"
      | Other -> "other"
      | Non_static_id s -> s
    let of_string =
      function
      | "unknownOperation" -> UnknownOperation
      | "cannotParse" -> CannotParse
      | "fieldValidationFailed" -> FieldValidationFailed
      | "other" -> Other
      | 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 ValidationExceptionReason" xml_arg0)
    let of_json j =
      of_string (string_of_json ~kind:"ValidationExceptionReason" j)
    let to_json = simple_to_json to_value
  end
module ActionFilterList =
  struct
    type nonrec t = ActionFilter.t list
    let make i = i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:ActionFilter.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:ActionFilter.of_xml)
    let of_json j =
      list_of_json ~kind:"ActionFilterList" ~of_json:ActionFilter.of_json j
    let to_json v = composed_to_json to_value v
  end
module AccessDeniedException =
  struct
    type nonrec t = {
      message: String_.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:String_.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" String_.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "You do not have sufficient access to perform this action."]
module InternalServerException =
  struct
    type nonrec t = {
      message: String_.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:String_.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" String_.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "An unexpected error occurred during the processing of your request."]
module NextToken =
  struct
    type nonrec t = string
    let context_ = "NextToken"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:8192) >>=
                  (fun () -> check_pattern i ~pattern:"[\\S\\s]*")));
        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:"NextToken" j
    let to_json = simple_to_json to_value
  end
module RecommendedActions =
  struct
    type nonrec t = RecommendedAction.t list
    let make i = i
    let of_string _ =
      failwithf "of_string is not implemented for List_shape objects" ()
      [@@warning "-32"]
    let to_value xs =
      (xs |> (List.map ~f:RecommendedAction.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:RecommendedAction.of_xml)
    let of_json j =
      list_of_json ~kind:"RecommendedActions"
        ~of_json:RecommendedAction.of_json j
    let to_json v = composed_to_json to_value v
  end
module ThrottlingException =
  struct
    type nonrec t = {
      message: String_.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:String_.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" String_.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "The request was denied due to request throttling."]
module ValidationException =
  struct
    type nonrec t =
      {
      message: String_.t option ;
      reason: ValidationExceptionReason.t option
        [@ocaml.doc
          "Provides a single, overarching explanation for the validation failure."];
      fieldList: ValidationExceptionFieldList.t option
        [@ocaml.doc
          "Lists each problematic field and why it failed validation."]}
    let make ?message =
      fun ?reason ->
        fun ?fieldList -> fun () -> { message; reason; fieldList }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value));
        ("reason",
          (Option.map x.reason ~f:ValidationExceptionReason.to_value));
        ("fieldList",
          (Option.map x.fieldList ~f:ValidationExceptionFieldList.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let fieldList =
        (Option.map ~f:ValidationExceptionFieldList.of_xml)
          (Xml.child xml_arg0 "fieldList") in
      let reason =
        (Option.map ~f:ValidationExceptionReason.of_xml)
          (Xml.child xml_arg0 "reason") in
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?fieldList ?reason ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let fieldList =
        field_map json__ "fieldList" ValidationExceptionFieldList.of_json in
      let reason =
        field_map json__ "reason" ValidationExceptionReason.of_json in
      let message = field_map json__ "message" String_.of_json in
      make ?fieldList ?reason ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The input fails to satisfy the constraints specified by an Amazon Web Services service."]
module MaxResults =
  struct
    type nonrec t = int
    let make i =
      let open Result in
        ok_or_failwith
          ((check_int_max i ~max:1000) >>= (fun () -> 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 MaxResults" 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 RequestFilter =
  struct
    type nonrec t =
      {
      actions: ActionFilterList.t option
        [@ocaml.doc
          "A list of action filters that define criteria for filtering results. Each filter specifies a key, match option, and corresponding values to filter on."]}
    let make ?actions = fun () -> { actions }
    let to_value x =
      structure_to_value
        [("actions", (Option.map x.actions ~f:ActionFilterList.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let actions =
        (Option.map ~f:ActionFilterList.of_xml)
          (Xml.child xml_arg0 "actions") in
      make ?actions ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let actions = field_map json__ "actions" ActionFilterList.of_json in
      make ?actions ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Enables filtering of results based on specified action criteria. You can define multiple action filters to refine results using combinations of feature type, severity level, and recommendation type."]
module ListRecommendedActionsResponse =
  struct
    type nonrec t =
      {
      recommendedActions: RecommendedActions.t option
        [@ocaml.doc
          "The list of recommended actions that satisfy the filter criteria."];
      nextToken: NextToken.t option
        [@ocaml.doc
          "The pagination token that indicates the next set of results that you want to retrieve."]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `InternalServerException of InternalServerException.t 
      | `ThrottlingException of ThrottlingException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?recommendedActions =
      fun ?nextToken -> fun () -> { recommendedActions; nextToken }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_json json)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ThrottlingException" ->
          `ThrottlingException (ThrottlingException.of_xml xml)
      | "ValidationException" ->
          `ValidationException (ValidationException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `AccessDeniedException e ->
          `Assoc
            [("error", (`String "AccessDeniedException"));
            ("details", (AccessDeniedException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ThrottlingException e ->
          `Assoc
            [("error", (`String "ThrottlingException"));
            ("details", (ThrottlingException.to_json e))]
      | `ValidationException e ->
          `Assoc
            [("error", (`String "ValidationException"));
            ("details", (ValidationException.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
        [("recommendedActions",
           (Option.map x.recommendedActions ~f:RecommendedActions.to_value));
        ("nextToken", (Option.map x.nextToken ~f:NextToken.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let nextToken =
        (Option.map ~f:NextToken.of_xml) (Xml.child xml_arg0 "nextToken") in
      let recommendedActions =
        (Option.map ~f:RecommendedActions.of_xml)
          (Xml.child xml_arg0 "recommendedActions") in
      make ?nextToken ?recommendedActions ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let nextToken = field_map json__ "nextToken" NextToken.of_json in
      let recommendedActions =
        field_map json__ "recommendedActions" RecommendedActions.of_json in
      make ?nextToken ?recommendedActions ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Returns a list of recommended actions that match the filter criteria."]
module ListRecommendedActionsRequest =
  struct
    type nonrec t =
      {
      filter: RequestFilter.t option
        [@ocaml.doc
          "The criteria that you want all returned recommended actions to match."];
      maxResults: MaxResults.t option
        [@ocaml.doc
          "The maximum number of results to return in the response."];
      nextToken: NextToken.t option
        [@ocaml.doc
          "The pagination token that indicates the next set of results that you want to retrieve."]}
    let make ?filter =
      fun ?maxResults ->
        fun ?nextToken -> fun () -> { filter; maxResults; nextToken }
    let to_value x =
      structure_to_value
        [("filter", (Option.map x.filter ~f:RequestFilter.to_value));
        ("maxResults", (Option.map x.maxResults ~f:MaxResults.to_value));
        ("nextToken", (Option.map x.nextToken ~f:NextToken.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let nextToken =
        (Option.map ~f:NextToken.of_xml) (Xml.child xml_arg0 "nextToken") in
      let maxResults =
        (Option.map ~f:MaxResults.of_xml) (Xml.child xml_arg0 "maxResults") in
      let filter =
        (Option.map ~f:RequestFilter.of_xml) (Xml.child xml_arg0 "filter") in
      make ?nextToken ?maxResults ?filter ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let nextToken = field_map json__ "nextToken" NextToken.of_json in
      let maxResults = field_map json__ "maxResults" MaxResults.of_json in
      let filter = field_map json__ "filter" RequestFilter.of_json in
      make ?nextToken ?maxResults ?filter ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Returns a list of recommended actions that match the filter criteria."]