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.marketplace_deployment
let apiVersion = "2023-01-25"
let endpointPrefix = "deployment-marketplace"
let serviceFullName = "AWS Marketplace Deployment Service"
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 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 ResourceId =
  struct
    type nonrec t = string
    let context_ = "ResourceId"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:64) >>=
                  (fun () -> check_pattern i ~pattern:"^[A-Za-z0-9_/-]+$")));
        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:"ResourceId" j
    let to_json = simple_to_json to_value
  end
module TagKey =
  struct
    type nonrec t = string
    let context_ = "TagKey"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:128) >>=
                  (fun () ->
                     check_pattern i ~pattern:"^[a-zA-Z0-9/_+=.:@-]+$")));
        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:"TagKey" j
    let to_json = simple_to_json to_value
  end
module TagValue =
  struct
    type nonrec t = string
    let context_ = "TagValue"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:256) >>=
                  (fun () ->
                     check_pattern i ~pattern:"^[a-zA-Z0-9/_+=.:@-]+$")));
        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:"TagValue" j
    let to_json = simple_to_json to_value
  end
module DeploymentParameterName =
  struct
    type nonrec t = string
    let context_ = "DeploymentParameterName"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:400) >>=
                  (fun () -> check_pattern i ~pattern:"^[a-zA-Z0-9/_+=.@-]+$")));
        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:"DeploymentParameterName" j
    let to_json = simple_to_json to_value
  end
module SecretString =
  struct
    type nonrec t = string
    let context_ = "SecretString"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_max i ~max:15000) >>=
             (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:"SecretString" j
    let to_json = simple_to_json to_value
  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 ConflictException =
  struct
    type nonrec t =
      {
      message: String_.t option ;
      resourceId: ResourceId.t option
        [@ocaml.doc
          "The unique identifier for the resource associated with the error."]}
    let make ?message = fun ?resourceId -> fun () -> { message; resourceId }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value));
        ("resourceId", (Option.map x.resourceId ~f:ResourceId.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let resourceId =
        (Option.map ~f:ResourceId.of_xml) (Xml.child xml_arg0 "resourceId") in
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?resourceId ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let resourceId = field_map json__ "resourceId" ResourceId.of_json in
      let message = field_map json__ "message" String_.of_json in
      make ?resourceId ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The request configuration has conflicts. For details, see the accompanying error message."]
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 "There was an internal service exception."]
module ResourceNotFoundException =
  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 specified resource wasn't found."]
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 "Too many requests."]
module ValidationException =
  struct
    type nonrec t =
      {
      fieldName: String_.t option
        [@ocaml.doc "The field name associated with the error."];
      message: String_.t option }
    let make ?fieldName = fun ?message -> fun () -> { fieldName; message }
    let to_value x =
      structure_to_value
        [("fieldName", (Option.map x.fieldName ~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 fieldName =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "fieldName") in
      make ?message ?fieldName ()
    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 fieldName = field_map json__ "fieldName" String_.of_json in
      make ?message ?fieldName ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "An error occurred during validation."]
module StringList =
  struct
    type nonrec t = String_.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:String_.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:String_.of_xml)
    let of_json j =
      list_of_json ~kind:"StringList" ~of_json:String_.of_json j
    let to_json v = composed_to_json to_value v
  end
module Tags =
  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 DeploymentParameterResourceIdentifier =
  struct
    type nonrec t = string
    let context_ = "DeploymentParameterResourceIdentifier"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:32) >>=
                  (fun () -> check_pattern i ~pattern:"^dp-[a-zA-Z0-9]+$")));
        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:"DeploymentParameterResourceIdentifier" j
    let to_json = simple_to_json to_value
  end
module ResourceArn =
  struct
    type nonrec t = string
    let context_ = "ResourceArn"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:2048) >>=
                  (fun () -> check_pattern i ~pattern:"^[a-zA-Z0-9:*/-]+$")));
        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:"ResourceArn" j
    let to_json = simple_to_json to_value
  end
module ServiceQuotaExceededException =
  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 maximum number of requests per account has been exceeded."]
module TagsMap =
  struct
    type nonrec t = (TagKey.t * TagValue.t) list
    let make i =
      let open Result in
        ok_or_failwith
          ((check_list_max i ~max:50) >>= (fun () -> check_list_min i ~min:0));
        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 ->
                            ((TagKey.of_string chopped),
                              (TagValue.of_string v))))))
    let to_value xs =
      (xs |>
         (List.map
            ~f:(fun (x, y) ->
                  (TagKey.to_value x) |>
                    (fun x -> (TagValue.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:TagKey.of_string
        ~of_json:TagValue.of_json j
    let to_json v = composed_to_json to_value v
  end
module Catalog =
  struct
    type nonrec t = string
    let context_ = "Catalog"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:64) >>=
                  (fun () -> check_pattern i ~pattern:"^[a-zA-Z_-]+$")));
        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:"Catalog" j
    let to_json = simple_to_json to_value
  end
module ClientToken =
  struct
    type nonrec t = string
    let context_ = "ClientToken"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:32) >>=
             (fun () ->
                (check_string_max i ~max:64) >>=
                  (fun () ->
                     check_pattern i ~pattern:"^[a-zA-Z0-9/_+=.:@-]+$")));
        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:"ClientToken" j
    let to_json = simple_to_json to_value
  end
module DeploymentParameterInput =
  struct
    type nonrec t =
      {
      name: DeploymentParameterName.t
        [@ocaml.doc
          "The desired name of the deployment parameter. This is the identifier on which deployment parameters are keyed for a given buyer and product. If this name matches an existing deployment parameter, this request will update the existing resource."];
      secretString: SecretString.t
        [@ocaml.doc "The text to encrypt and store in the secret."]}
    let context_ = "DeploymentParameterInput"
    let make ~name = fun ~secretString -> fun () -> { name; secretString }
    let to_value x =
      structure_to_value
        [("name", (Some (DeploymentParameterName.to_value x.name)));
        ("secretString", (Some (SecretString.to_value x.secretString)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let secretString =
        SecretString.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "secretString") in
      let name =
        DeploymentParameterName.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "name") in
      make ~secretString ~name ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let secretString =
        field_map_exn json__ "secretString" SecretString.of_json in
      let name = field_map_exn json__ "name" DeploymentParameterName.of_json in
      make ~secretString ~name ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "The shape containing the requested deployment parameter name and secretString. To support AWS CloudFormation dynamic references to this resource using Quick Launch, this value must match a parameter defined in the CloudFormation templated provided to buyers."]
module SyntheticTimestamp_date_time =
  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 UntagResourceResponse =
  struct
    type nonrec t = unit
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `ConflictException of ConflictException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `ThrottlingException of ThrottlingException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make () = ()
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.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)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.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))]
      | `ConflictException e ->
          `Assoc
            [("error", (`String "ConflictException"));
            ("details", (ConflictException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.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 of_header_and_body = ((fun (xs, pipe) -> make ())[@warning "-27"])
    let to_value _ = `Structure []
    let to_query v = to_query to_value v
    let of_xml _ = make ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json _ = make ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Removes a tag or list of tags from a resource."]
module UntagResourceRequest =
  struct
    type nonrec t =
      {
      resourceArn: String_.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) associated with the resource you want to remove the tag from."];
      tagKeys: StringList.t
        [@ocaml.doc "A list of key names of tags to be removed."]}
    let context_ = "UntagResourceRequest"
    let make ~resourceArn =
      fun ~tagKeys -> fun () -> { resourceArn; tagKeys }
    let to_value x =
      structure_to_value
        [("resourceArn", (Some (String_.to_value x.resourceArn)));
        ("tagKeys", (Some (StringList.to_value x.tagKeys)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let tagKeys =
        StringList.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "tagKeys") in
      let resourceArn =
        String_.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "resourceArn") in
      make ~tagKeys ~resourceArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let tagKeys = field_map_exn json__ "tagKeys" StringList.of_json in
      let resourceArn = field_map_exn json__ "resourceArn" String_.of_json in
      make ~tagKeys ~resourceArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Removes a tag or list of tags from a resource."]
module TagResourceResponse =
  struct
    type nonrec t = unit
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `ConflictException of ConflictException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `ThrottlingException of ThrottlingException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make () = ()
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.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)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.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))]
      | `ConflictException e ->
          `Assoc
            [("error", (`String "ConflictException"));
            ("details", (ConflictException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.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 of_header_and_body = ((fun (xs, pipe) -> make ())[@warning "-27"])
    let to_value _ = `Structure []
    let to_query v = to_query to_value v
    let of_xml _ = make ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json _ = make ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Tags a resource."]
module TagResourceRequest =
  struct
    type nonrec t =
      {
      resourceArn: String_.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) associated with the resource you want to tag."];
      tags: Tags.t option
        [@ocaml.doc
          "A map of key-value pairs, where each pair represents a tag present on the resource."]}
    let context_ = "TagResourceRequest"
    let make ?tags = fun ~resourceArn -> fun () -> { tags; resourceArn }
    let to_value x =
      structure_to_value
        [("resourceArn", (Some (String_.to_value x.resourceArn)));
        ("tags", (Option.map x.tags ~f:Tags.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let tags = (Option.map ~f:Tags.of_xml) (Xml.child xml_arg0 "tags") in
      let resourceArn =
        String_.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "resourceArn") in
      make ?tags ~resourceArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let tags = field_map json__ "tags" Tags.of_json in
      let resourceArn = field_map_exn json__ "resourceArn" String_.of_json in
      make ?tags ~resourceArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Tags a resource."]
module PutDeploymentParameterResponse =
  struct
    type nonrec t =
      {
      agreementId: ResourceId.t option
        [@ocaml.doc "The unique identifier of the agreement."];
      deploymentParameterId: DeploymentParameterResourceIdentifier.t option
        [@ocaml.doc "The unique identifier of the deployment parameter."];
      resourceArn: ResourceArn.t option
        [@ocaml.doc
          "The Amazon Resource Name (ARN) associated with the deployment parameter resource you want to create or update."];
      tags: TagsMap.t option
        [@ocaml.doc
          "A map of key-value pairs, where each pair represents a tag saved to the resource. Tags will only be applied for create operations, and they'll be ignored if the resource already exists."]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `ConflictException of ConflictException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `ServiceQuotaExceededException of ServiceQuotaExceededException.t 
      | `ThrottlingException of ThrottlingException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?agreementId =
      fun ?deploymentParameterId ->
        fun ?resourceArn ->
          fun ?tags ->
            fun () ->
              { agreementId; deploymentParameterId; resourceArn; tags }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_json json)
      | "ServiceQuotaExceededException" ->
          `ServiceQuotaExceededException
            (ServiceQuotaExceededException.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)
      | "ConflictException" ->
          `ConflictException (ConflictException.of_xml xml)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_xml xml)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.of_xml xml)
      | "ServiceQuotaExceededException" ->
          `ServiceQuotaExceededException
            (ServiceQuotaExceededException.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))]
      | `ConflictException e ->
          `Assoc
            [("error", (`String "ConflictException"));
            ("details", (ConflictException.to_json e))]
      | `InternalServerException e ->
          `Assoc
            [("error", (`String "InternalServerException"));
            ("details", (InternalServerException.to_json e))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.to_json e))]
      | `ServiceQuotaExceededException e ->
          `Assoc
            [("error", (`String "ServiceQuotaExceededException"));
            ("details", (ServiceQuotaExceededException.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
        [("agreementId", (Option.map x.agreementId ~f:ResourceId.to_value));
        ("deploymentParameterId",
          (Option.map x.deploymentParameterId
             ~f:DeploymentParameterResourceIdentifier.to_value));
        ("resourceArn", (Option.map x.resourceArn ~f:ResourceArn.to_value));
        ("tags", (Option.map x.tags ~f:TagsMap.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let tags = (Option.map ~f:TagsMap.of_xml) (Xml.child xml_arg0 "tags") in
      let resourceArn =
        (Option.map ~f:ResourceArn.of_xml) (Xml.child xml_arg0 "resourceArn") in
      let deploymentParameterId =
        (Option.map ~f:DeploymentParameterResourceIdentifier.of_xml)
          (Xml.child xml_arg0 "deploymentParameterId") in
      let agreementId =
        (Option.map ~f:ResourceId.of_xml) (Xml.child xml_arg0 "agreementId") in
      make ?tags ?resourceArn ?deploymentParameterId ?agreementId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let tags = field_map json__ "tags" TagsMap.of_json in
      let resourceArn = field_map json__ "resourceArn" ResourceArn.of_json in
      let deploymentParameterId =
        field_map json__ "deploymentParameterId"
          DeploymentParameterResourceIdentifier.of_json in
      let agreementId = field_map json__ "agreementId" ResourceId.of_json in
      make ?tags ?resourceArn ?deploymentParameterId ?agreementId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Creates or updates a deployment parameter and is targeted by catalog and agreementId."]
module PutDeploymentParameterRequest =
  struct
    type nonrec t =
      {
      agreementId: ResourceId.t
        [@ocaml.doc "The unique identifier of the agreement."];
      catalog: Catalog.t
        [@ocaml.doc
          "The catalog related to the request. Fixed value: AWSMarketplace"];
      clientToken: ClientToken.t option
        [@ocaml.doc
          "The idempotency token for deployment parameters. A unique identifier for the new version. This field is not required if you're calling using an AWS SDK. Otherwise, a clientToken must be provided with the request."];
      deploymentParameter: DeploymentParameterInput.t
        [@ocaml.doc
          "The deployment parameter targeted to the acceptor of an agreement for which to create the AWS Secret Manager resource."];
      expirationDate: SyntheticTimestamp_date_time.t option
        [@ocaml.doc
          "The date when deployment parameters expire and are scheduled for deletion."];
      productId: ResourceId.t
        [@ocaml.doc
          "The product for which AWS Marketplace will save secrets for the buyer\226\128\153s account."];
      tags: TagsMap.t option
        [@ocaml.doc
          "A map of key-value pairs, where each pair represents a tag saved to the resource. Tags will only be applied for create operations, and they'll be ignored if the resource already exists."]}
    let context_ = "PutDeploymentParameterRequest"
    let make ?clientToken =
      fun ?expirationDate ->
        fun ?tags ->
          fun ~agreementId ->
            fun ~catalog ->
              fun ~deploymentParameter ->
                fun ~productId ->
                  fun () ->
                    {
                      clientToken;
                      expirationDate;
                      tags;
                      agreementId;
                      catalog;
                      deploymentParameter;
                      productId
                    }
    let to_value x =
      structure_to_value
        [("agreementId", (Some (ResourceId.to_value x.agreementId)));
        ("catalog", (Some (Catalog.to_value x.catalog)));
        ("clientToken", (Option.map x.clientToken ~f:ClientToken.to_value));
        ("deploymentParameter",
          (Some (DeploymentParameterInput.to_value x.deploymentParameter)));
        ("expirationDate",
          (Option.map x.expirationDate
             ~f:SyntheticTimestamp_date_time.to_value));
        ("productId", (Some (ResourceId.to_value x.productId)));
        ("tags", (Option.map x.tags ~f:TagsMap.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let tags = (Option.map ~f:TagsMap.of_xml) (Xml.child xml_arg0 "tags") in
      let productId =
        ResourceId.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "productId") in
      let expirationDate =
        (Option.map ~f:SyntheticTimestamp_date_time.of_xml)
          (Xml.child xml_arg0 "expirationDate") in
      let deploymentParameter =
        DeploymentParameterInput.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "deploymentParameter") in
      let clientToken =
        (Option.map ~f:ClientToken.of_xml) (Xml.child xml_arg0 "clientToken") in
      let catalog =
        Catalog.of_xml (Xml.child_exn ~context:context_ xml_arg0 "catalog") in
      let agreementId =
        ResourceId.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "agreementId") in
      make ?tags ~productId ?expirationDate ~deploymentParameter ?clientToken
        ~catalog ~agreementId ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let tags = field_map json__ "tags" TagsMap.of_json in
      let productId = field_map_exn json__ "productId" ResourceId.of_json in
      let expirationDate =
        field_map json__ "expirationDate"
          SyntheticTimestamp_date_time.of_json in
      let deploymentParameter =
        field_map_exn json__ "deploymentParameter"
          DeploymentParameterInput.of_json in
      let clientToken = field_map json__ "clientToken" ClientToken.of_json in
      let catalog = field_map_exn json__ "catalog" Catalog.of_json in
      let agreementId = field_map_exn json__ "agreementId" ResourceId.of_json in
      make ?tags ~productId ?expirationDate ~deploymentParameter ?clientToken
        ~catalog ~agreementId ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Creates or updates a deployment parameter and is targeted by catalog and agreementId."]
module ListTagsForResourceResponse =
  struct
    type nonrec t =
      {
      tags: Tags.t option
        [@ocaml.doc
          "A map of key-value pairs, where each pair represents a tag present on the resource."]}
    type nonrec error =
      [ `AccessDeniedException of AccessDeniedException.t 
      | `InternalServerException of InternalServerException.t 
      | `ResourceNotFoundException of ResourceNotFoundException.t 
      | `ThrottlingException of ThrottlingException.t 
      | `ValidationException of ValidationException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?tags = fun () -> { tags }
    let error_of_json name json =
      match name with
      | "AccessDeniedException" ->
          `AccessDeniedException (AccessDeniedException.of_json json)
      | "InternalServerException" ->
          `InternalServerException (InternalServerException.of_json json)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.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)
      | "ResourceNotFoundException" ->
          `ResourceNotFoundException (ResourceNotFoundException.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))]
      | `ResourceNotFoundException e ->
          `Assoc
            [("error", (`String "ResourceNotFoundException"));
            ("details", (ResourceNotFoundException.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 [("tags", (Option.map x.tags ~f:Tags.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let tags = (Option.map ~f:Tags.of_xml) (Xml.child xml_arg0 "tags") in
      make ?tags ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let tags = field_map json__ "tags" Tags.of_json in make ?tags ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Lists all tags that have been added to a deployment parameter resource."]
module ListTagsForResourceRequest =
  struct
    type nonrec t =
      {
      resourceArn: String_.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) associated with the deployment parameter resource you want to list tags on."]}
    let context_ = "ListTagsForResourceRequest"
    let make ~resourceArn = fun () -> { resourceArn }
    let to_value x =
      structure_to_value
        [("resourceArn", (Some (String_.to_value x.resourceArn)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let resourceArn =
        String_.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "resourceArn") in
      make ~resourceArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let resourceArn = field_map_exn json__ "resourceArn" String_.of_json in
      make ~resourceArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Lists all tags that have been added to a deployment parameter resource."]