Source file values.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
(* 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.mediastore_data
let apiVersion = "2017-09-01"
let endpointPrefix = "data.mediastore"
let serviceFullName = "AWS Elemental MediaStore Data Plane"
let signatureVersion = "v4"
let protocol = "rest_json"
let globalEndpoint = endpointPrefix ^ ".amazonaws.com"
let serviceAbbreviation = "MediaStore Data"
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 ContentType =
  struct
    type nonrec t = string
    let context_ = "ContentType"
    let make i =
      let open Result in
        ok_or_failwith
          (check_pattern i ~pattern:"^[\\w\\-\\/\\.\\+]{1,255}$");
        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:"ContentType" j
    let to_json = simple_to_json to_value
  end
module ETag =
  struct
    type nonrec t = string
    let context_ = "ETag"
    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:"[0-9A-Fa-f]+")));
        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:"ETag" j
    let to_json = simple_to_json to_value
  end
module ItemName =
  struct
    type nonrec t = string
    let context_ = "ItemName"
    let make i =
      let open Result in
        ok_or_failwith (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:"ItemName" j
    let to_json = simple_to_json to_value
  end
module ItemType =
  struct
    type nonrec t =
      | OBJECT 
      | FOLDER 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | OBJECT -> "OBJECT"
      | FOLDER -> "FOLDER"
      | Non_static_id s -> s
    let of_string =
      function
      | "OBJECT" -> OBJECT
      | "FOLDER" -> FOLDER
      | 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 ItemType" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"ItemType" j)
    let to_json = simple_to_json to_value
  end
module NonNegativeLong =
  struct
    type nonrec t = Int64.t
    let make i =
      let open Result in ok_or_failwith (check_int64_min i ~min:0L); i
    let of_string = Int64.of_string
    let to_value x = `Long x
    let to_query v = to_query to_value v
    let to_header x = Int64.to_string x
    let of_xml xml_arg0 =
      Int64.of_string (string_of_xml ~kind:"a long" xml_arg0)
    let of_json j = Int64.of_float (float_of_json ~kind:"a long" j)
    let to_json = simple_to_json to_value
  end
module TimeStamp =
  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 ErrorMessage =
  struct
    type nonrec t = string
    let context_ = "ErrorMessage"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:255) >>=
                  (fun () -> check_pattern i ~pattern:"[ \\w:\\.\\?-]+")));
        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 Item =
  struct
    type nonrec t =
      {
      name: ItemName.t option [@ocaml.doc "The name of the item."];
      type_: ItemType.t option
        [@ocaml.doc "The item type (folder or object)."];
      eTag: ETag.t option
        [@ocaml.doc
          "The ETag that represents a unique instance of the item."];
      lastModified: TimeStamp.t option
        [@ocaml.doc "The date and time that the item was last modified."];
      contentType: ContentType.t option
        [@ocaml.doc "The content type of the item."];
      contentLength: NonNegativeLong.t option
        [@ocaml.doc "The length of the item in bytes."]}
    let make ?name =
      fun ?type_ ->
        fun ?eTag ->
          fun ?lastModified ->
            fun ?contentType ->
              fun ?contentLength ->
                fun () ->
                  {
                    name;
                    type_;
                    eTag;
                    lastModified;
                    contentType;
                    contentLength
                  }
    let to_value x =
      structure_to_value
        [("Name", (Option.map x.name ~f:ItemName.to_value));
        ("Type", (Option.map x.type_ ~f:ItemType.to_value));
        ("ETag", (Option.map x.eTag ~f:ETag.to_value));
        ("LastModified", (Option.map x.lastModified ~f:TimeStamp.to_value));
        ("ContentType", (Option.map x.contentType ~f:ContentType.to_value));
        ("ContentLength",
          (Option.map x.contentLength ~f:NonNegativeLong.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let contentLength =
        (Option.map ~f:NonNegativeLong.of_xml)
          (Xml.child xml_arg0 "ContentLength") in
      let contentType =
        (Option.map ~f:ContentType.of_xml) (Xml.child xml_arg0 "ContentType") in
      let lastModified =
        (Option.map ~f:TimeStamp.of_xml) (Xml.child xml_arg0 "LastModified") in
      let eTag = (Option.map ~f:ETag.of_xml) (Xml.child xml_arg0 "ETag") in
      let type_ = (Option.map ~f:ItemType.of_xml) (Xml.child xml_arg0 "Type") in
      let name = (Option.map ~f:ItemName.of_xml) (Xml.child xml_arg0 "Name") in
      make ?contentLength ?contentType ?lastModified ?eTag ?type_ ?name ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let contentLength =
        field_map json__ "ContentLength" NonNegativeLong.of_json in
      let contentType = field_map json__ "ContentType" ContentType.of_json in
      let lastModified = field_map json__ "LastModified" TimeStamp.of_json in
      let eTag = field_map json__ "ETag" ETag.of_json in
      let type_ = field_map json__ "Type" ItemType.of_json in
      let name = field_map json__ "Name" ItemName.of_json in
      make ?contentLength ?contentType ?lastModified ?eTag ?type_ ?name ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "A metadata entry for a folder or object."]
module ContainerNotFoundException =
  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 container was not found for the specified account."]
module InternalServerError =
  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 service is temporarily unavailable."]
module SHA256Hash =
  struct
    type nonrec t = string
    let context_ = "SHA256Hash"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:64) >>=
             (fun () ->
                (check_string_max i ~max:64) >>=
                  (fun () -> check_pattern i ~pattern:"[0-9A-Fa-f]{64}")));
        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:"SHA256Hash" j
    let to_json = simple_to_json to_value
  end
module StorageClass =
  struct
    type nonrec t =
      | TEMPORAL 
      | Non_static_id of string 
    let make i = i
    let to_string = function | TEMPORAL -> "TEMPORAL" | Non_static_id s -> s
    let of_string = function | "TEMPORAL" -> TEMPORAL | 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 StorageClass" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"StorageClass" j)
    let to_json = simple_to_json to_value
  end
module PathNaming =
  struct
    type nonrec t = string
    let context_ = "PathNaming"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:900) >>=
                  (fun () ->
                     check_pattern i
                       ~pattern:"(?:[A-Za-z0-9_\\.\\-\\~]+/){0,10}[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:"PathNaming" j
    let to_json = simple_to_json to_value
  end
module PayloadBlob =
  struct
    type nonrec t = string
    let make i = i
    let of_string x = x
    let to_value x = `Blob x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml xml_arg0 = string_of_xml ~kind:"a blob" xml_arg0
    let of_json j = string_of_json ~kind:"a blob" j
    let to_json = simple_to_json to_value
  end
module StringPrimitive =
  struct
    type nonrec t = string
    let context_ = "StringPrimitive"
    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:"StringPrimitive" j
    let to_json = simple_to_json to_value
  end
module UploadAvailability =
  struct
    type nonrec t =
      | STANDARD 
      | STREAMING 
      | Non_static_id of string 
    let make i = i
    let to_string =
      function
      | STANDARD -> "STANDARD"
      | STREAMING -> "STREAMING"
      | Non_static_id s -> s
    let of_string =
      function
      | "STANDARD" -> STANDARD
      | "STREAMING" -> STREAMING
      | 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 UploadAvailability" xml_arg0)
    let of_json j = of_string (string_of_json ~kind:"UploadAvailability" j)
    let to_json = simple_to_json to_value
  end
module ItemList =
  struct
    type nonrec t = Item.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: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 PaginationToken =
  struct
    type nonrec t = string
    let context_ = "PaginationToken"
    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:"PaginationToken" j
    let to_json = simple_to_json to_value
  end
module ListLimit =
  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 ListLimit" 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 ListPathNaming =
  struct
    type nonrec t = string
    let context_ = "ListPathNaming"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:0) >>=
             (fun () ->
                (check_string_max i ~max:900) >>=
                  (fun () ->
                     check_pattern i
                       ~pattern:"/?(?:[A-Za-z0-9_\\.\\-\\~]+/){0,10}(?:[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:"ListPathNaming" j
    let to_json = simple_to_json to_value
  end
module ContentRangePattern =
  struct
    type nonrec t = string
    let context_ = "ContentRangePattern"
    let make i =
      let open Result in
        ok_or_failwith (check_pattern i ~pattern:"^bytes=\\d+\\-\\d+/\\d+$");
        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:"ContentRangePattern" j
    let to_json = simple_to_json to_value
  end
module ObjectNotFoundException =
  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 perform an operation on an object that does not exist."]
module RequestedRangeNotSatisfiableException =
  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 requested content range is not valid."]
module StatusCode =
  struct
    type nonrec t = int
    let make i = 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 statusCode" 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 RangePattern =
  struct
    type nonrec t = string
    let context_ = "RangePattern"
    let make i =
      let open Result in
        ok_or_failwith
          (check_pattern i ~pattern:"^bytes=(?:\\d+\\-\\d*|\\d*\\-\\d+)$");
        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:"RangePattern" j
    let to_json = simple_to_json to_value
  end
module PutObjectResponse =
  struct
    type nonrec t =
      {
      contentSHA256: SHA256Hash.t option
        [@ocaml.doc "The SHA256 digest of the object that is persisted."];
      eTag: ETag.t option
        [@ocaml.doc "Unique identifier of the object in the container."];
      storageClass: StorageClass.t option
        [@ocaml.doc
          "The storage class where the object was persisted. The class should be \226\128\156Temporal\226\128\157."]}
    type nonrec error =
      [ `ContainerNotFoundException of ContainerNotFoundException.t 
      | `InternalServerError of InternalServerError.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?contentSHA256 =
      fun ?eTag ->
        fun ?storageClass -> fun () -> { contentSHA256; eTag; storageClass }
    let error_of_json name json =
      match name with
      | "ContainerNotFoundException" ->
          `ContainerNotFoundException
            (ContainerNotFoundException.of_json json)
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "ContainerNotFoundException" ->
          `ContainerNotFoundException (ContainerNotFoundException.of_xml xml)
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `ContainerNotFoundException e ->
          `Assoc
            [("error", (`String "ContainerNotFoundException"));
            ("details", (ContainerNotFoundException.to_json e))]
      | `InternalServerError e ->
          `Assoc
            [("error", (`String "InternalServerError"));
            ("details", (InternalServerError.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
        [("ContentSHA256",
           (Option.map x.contentSHA256 ~f:SHA256Hash.to_value));
        ("ETag", (Option.map x.eTag ~f:ETag.to_value));
        ("StorageClass",
          (Option.map x.storageClass ~f:StorageClass.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let storageClass =
        (Option.map ~f:StorageClass.of_xml)
          (Xml.child xml_arg0 "StorageClass") in
      let eTag = (Option.map ~f:ETag.of_xml) (Xml.child xml_arg0 "ETag") in
      let contentSHA256 =
        (Option.map ~f:SHA256Hash.of_xml)
          (Xml.child xml_arg0 "ContentSHA256") in
      make ?storageClass ?eTag ?contentSHA256 ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let storageClass = field_map json__ "StorageClass" StorageClass.of_json in
      let eTag = field_map json__ "ETag" ETag.of_json in
      let contentSHA256 = field_map json__ "ContentSHA256" SHA256Hash.of_json in
      make ?storageClass ?eTag ?contentSHA256 ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Uploads an object to the specified path. Object sizes are limited to 25 MB for standard upload availability and 10 MB for streaming upload availability."]
module PutObjectRequest =
  struct
    type nonrec t =
      {
      body: PayloadBlob.t [@ocaml.doc "The bytes to be stored."];
      path: PathNaming.t
        [@ocaml.doc
          "The path (including the file name) where the object is stored in the container. Format: <folder name>/<folder name>/<file name> For example, to upload the file mlaw.avi to the folder path premium\\canada in the container movies, enter the path premium/canada/mlaw.avi. Do not include the container name in this path. If the path includes any folders that don't exist yet, the service creates them. For example, suppose you have an existing premium/usa subfolder. If you specify premium/canada, the service creates a canada subfolder in the premium folder. You then have two subfolders, usa and canada, in the premium folder. There is no correlation between the path to the source and the path (folders) in the container in AWS Elemental MediaStore. For more information about folders and how they exist in a container, see the AWS Elemental MediaStore User Guide. The file name is the name that is assigned to the file that you upload. The file can have the same name inside and outside of AWS Elemental MediaStore, or it can have the same name. The file name can include or omit an extension."];
      contentType: ContentType.t option
        [@ocaml.doc "The content type of the object."];
      cacheControl: StringPrimitive.t option
        [@ocaml.doc
          "An optional CacheControl header that allows the caller to control the object's cache behavior. Headers can be passed in as specified in the HTTP at https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9. Headers with a custom user-defined value are also accepted."];
      storageClass: StorageClass.t option
        [@ocaml.doc
          "Indicates the storage class of a Put request. Defaults to high-performance temporal storage class, and objects are persisted into durable storage shortly after being received."];
      uploadAvailability: UploadAvailability.t option
        [@ocaml.doc
          "Indicates the availability of an object while it is still uploading. If the value is set to streaming, the object is available for downloading after some initial buffering but before the object is uploaded completely. If the value is set to standard, the object is available for downloading only when it is uploaded completely. The default value for this header is standard. To use this header, you must also set the HTTP Transfer-Encoding header to chunked."]}
    let context_ = "PutObjectRequest"
    let make ?contentType =
      fun ?cacheControl ->
        fun ?storageClass ->
          fun ?uploadAvailability ->
            fun ~body ->
              fun ~path ->
                fun () ->
                  {
                    contentType;
                    cacheControl;
                    storageClass;
                    uploadAvailability;
                    body;
                    path
                  }
    let of_header_and_body =
      ((fun (xs, pipe) ->
          make ~body:pipe
            ~path:(PathNaming.of_string
                     ((List.Assoc.find_exn ~equal:String.Caseless.equal) xs
                        "Path"))
            ?contentType:(Option.map
                            ((List.Assoc.find ~equal:String.Caseless.equal)
                               xs "Content-Type") ~f:ContentType.of_string)
            ?cacheControl:(Option.map
                             ((List.Assoc.find ~equal:String.Caseless.equal)
                                xs "Cache-Control")
                             ~f:StringPrimitive.of_string)
            ?storageClass:(Option.map
                             ((List.Assoc.find ~equal:String.Caseless.equal)
                                xs "x-amz-storage-class")
                             ~f:StorageClass.of_string)
            ?uploadAvailability:(Option.map
                                   ((List.Assoc.find
                                       ~equal:String.Caseless.equal) xs
                                      "x-amz-upload-availability")
                                   ~f:UploadAvailability.of_string) ())
      [@warning "-27"])
    let to_value x =
      structure_to_value
        [("Body", (Some (PayloadBlob.to_value x.body)));
        ("Path", (Some (PathNaming.to_value x.path)));
        ("Content-Type", (Option.map x.contentType ~f:ContentType.to_value));
        ("Cache-Control",
          (Option.map x.cacheControl ~f:StringPrimitive.to_value));
        ("x-amz-storage-class",
          (Option.map x.storageClass ~f:StorageClass.to_value));
        ("x-amz-upload-availability",
          (Option.map x.uploadAvailability ~f:UploadAvailability.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let uploadAvailability =
        (Option.map ~f:UploadAvailability.of_xml)
          (Xml.child xml_arg0 "x-amz-upload-availability") in
      let storageClass =
        (Option.map ~f:StorageClass.of_xml)
          (Xml.child xml_arg0 "x-amz-storage-class") in
      let cacheControl =
        (Option.map ~f:StringPrimitive.of_xml)
          (Xml.child xml_arg0 "Cache-Control") in
      let contentType =
        (Option.map ~f:ContentType.of_xml)
          (Xml.child xml_arg0 "Content-Type") in
      let path =
        PathNaming.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Path") in
      let body =
        PayloadBlob.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Body") in
      make ?uploadAvailability ?storageClass ?cacheControl ?contentType ~path
        ~body ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let uploadAvailability =
        field_map json__ "UploadAvailability" UploadAvailability.of_json in
      let storageClass = field_map json__ "StorageClass" StorageClass.of_json in
      let cacheControl =
        field_map json__ "CacheControl" StringPrimitive.of_json in
      let contentType = field_map json__ "ContentType" ContentType.of_json in
      let path = field_map_exn json__ "Path" PathNaming.of_json in
      let body = field_map_exn json__ "Body" PayloadBlob.of_json in
      make ?uploadAvailability ?storageClass ?cacheControl ?contentType ~path
        ~body ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Uploads an object to the specified path. Object sizes are limited to 25 MB for standard upload availability and 10 MB for streaming upload availability."]
module ListItemsResponse =
  struct
    type nonrec t =
      {
      items: ItemList.t option
        [@ocaml.doc
          "The metadata entries for the folders and objects at the requested path."];
      nextToken: PaginationToken.t option
        [@ocaml.doc
          "The token that can be used in a request to view the next set of results. For example, you submit a ListItems request that matches 2,000 items with MaxResults set at 500. The service returns the first batch of results (up to 500) and a NextToken value that can be used to fetch the next batch of results."]}
    type nonrec error =
      [ `ContainerNotFoundException of ContainerNotFoundException.t 
      | `InternalServerError of InternalServerError.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?items = fun ?nextToken -> fun () -> { items; nextToken }
    let error_of_json name json =
      match name with
      | "ContainerNotFoundException" ->
          `ContainerNotFoundException
            (ContainerNotFoundException.of_json json)
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "ContainerNotFoundException" ->
          `ContainerNotFoundException (ContainerNotFoundException.of_xml xml)
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `ContainerNotFoundException e ->
          `Assoc
            [("error", (`String "ContainerNotFoundException"));
            ("details", (ContainerNotFoundException.to_json e))]
      | `InternalServerError e ->
          `Assoc
            [("error", (`String "InternalServerError"));
            ("details", (InternalServerError.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
        [("Items", (Option.map x.items ~f:ItemList.to_value));
        ("NextToken", (Option.map x.nextToken ~f:PaginationToken.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let nextToken =
        (Option.map ~f:PaginationToken.of_xml)
          (Xml.child xml_arg0 "NextToken") in
      let items =
        (Option.map ~f:ItemList.of_xml) (Xml.child xml_arg0 "Items") in
      make ?nextToken ?items ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let nextToken = field_map json__ "NextToken" PaginationToken.of_json in
      let items = field_map json__ "Items" ItemList.of_json in
      make ?nextToken ?items ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Provides a list of metadata entries about folders and objects in the specified folder."]
module ListItemsRequest =
  struct
    type nonrec t =
      {
      path: ListPathNaming.t option
        [@ocaml.doc
          "The path in the container from which to retrieve items. Format: <folder name>/<folder name>/<file name>"];
      maxResults: ListLimit.t option
        [@ocaml.doc
          "The maximum number of results to return per API request. For example, you submit a ListItems request with MaxResults set at 500. Although 2,000 items match your request, the service returns no more than the first 500 items. (The service also returns a NextToken value that you can use to fetch the next batch of results.) The service might return fewer results than the MaxResults value. If MaxResults is not included in the request, the service defaults to pagination with a maximum of 1,000 results per page."];
      nextToken: PaginationToken.t option
        [@ocaml.doc
          "The token that identifies which batch of results that you want to see. For example, you submit a ListItems request with MaxResults set at 500. The service returns the first batch of results (up to 500) and a NextToken value. To see the next batch of results, you can submit the ListItems request a second time and specify the NextToken value. Tokens expire after 15 minutes."]}
    let make ?path =
      fun ?maxResults ->
        fun ?nextToken -> fun () -> { path; maxResults; nextToken }
    let to_value x =
      structure_to_value
        [("Path", (Option.map x.path ~f:ListPathNaming.to_value));
        ("MaxResults", (Option.map x.maxResults ~f:ListLimit.to_value));
        ("NextToken", (Option.map x.nextToken ~f:PaginationToken.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let nextToken =
        (Option.map ~f:PaginationToken.of_xml)
          (Xml.child xml_arg0 "NextToken") in
      let maxResults =
        (Option.map ~f:ListLimit.of_xml) (Xml.child xml_arg0 "MaxResults") in
      let path =
        (Option.map ~f:ListPathNaming.of_xml) (Xml.child xml_arg0 "Path") in
      make ?nextToken ?maxResults ?path ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let nextToken = field_map json__ "NextToken" PaginationToken.of_json in
      let maxResults = field_map json__ "MaxResults" ListLimit.of_json in
      let path = field_map json__ "Path" ListPathNaming.of_json in
      make ?nextToken ?maxResults ?path ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Provides a list of metadata entries about folders and objects in the specified folder."]
module GetObjectResponse =
  struct
    type nonrec t =
      {
      body: PayloadBlob.t option [@ocaml.doc "The bytes of the object."];
      cacheControl: StringPrimitive.t option
        [@ocaml.doc
          "An optional CacheControl header that allows the caller to control the object's cache behavior. Headers can be passed in as specified in the HTTP spec at https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9. Headers with a custom user-defined value are also accepted."];
      contentRange: ContentRangePattern.t option
        [@ocaml.doc "The range of bytes to retrieve."];
      contentLength: NonNegativeLong.t option
        [@ocaml.doc "The length of the object in bytes."];
      contentType: ContentType.t option
        [@ocaml.doc "The content type of the object."];
      eTag: ETag.t option
        [@ocaml.doc
          "The ETag that represents a unique instance of the object."];
      lastModified: TimeStamp.t option
        [@ocaml.doc "The date and time that the object was last modified."];
      statusCode: StatusCode.t option
        [@ocaml.doc
          "The HTML status code of the request. Status codes ranging from 200 to 299 indicate success. All other status codes indicate the type of error that occurred."]}
    type nonrec error =
      [ `ContainerNotFoundException of ContainerNotFoundException.t 
      | `InternalServerError of InternalServerError.t 
      | `ObjectNotFoundException of ObjectNotFoundException.t 
      | `RequestedRangeNotSatisfiableException of
          RequestedRangeNotSatisfiableException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?body =
      fun ?cacheControl ->
        fun ?contentRange ->
          fun ?contentLength ->
            fun ?contentType ->
              fun ?eTag ->
                fun ?lastModified ->
                  fun ?statusCode ->
                    fun () ->
                      {
                        body;
                        cacheControl;
                        contentRange;
                        contentLength;
                        contentType;
                        eTag;
                        lastModified;
                        statusCode
                      }
    let error_of_json name json =
      match name with
      | "ContainerNotFoundException" ->
          `ContainerNotFoundException
            (ContainerNotFoundException.of_json json)
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_json json)
      | "ObjectNotFoundException" ->
          `ObjectNotFoundException (ObjectNotFoundException.of_json json)
      | "RequestedRangeNotSatisfiableException" ->
          `RequestedRangeNotSatisfiableException
            (RequestedRangeNotSatisfiableException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "ContainerNotFoundException" ->
          `ContainerNotFoundException (ContainerNotFoundException.of_xml xml)
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_xml xml)
      | "ObjectNotFoundException" ->
          `ObjectNotFoundException (ObjectNotFoundException.of_xml xml)
      | "RequestedRangeNotSatisfiableException" ->
          `RequestedRangeNotSatisfiableException
            (RequestedRangeNotSatisfiableException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `ContainerNotFoundException e ->
          `Assoc
            [("error", (`String "ContainerNotFoundException"));
            ("details", (ContainerNotFoundException.to_json e))]
      | `InternalServerError e ->
          `Assoc
            [("error", (`String "InternalServerError"));
            ("details", (InternalServerError.to_json e))]
      | `ObjectNotFoundException e ->
          `Assoc
            [("error", (`String "ObjectNotFoundException"));
            ("details", (ObjectNotFoundException.to_json e))]
      | `RequestedRangeNotSatisfiableException e ->
          `Assoc
            [("error", (`String "RequestedRangeNotSatisfiableException"));
            ("details", (RequestedRangeNotSatisfiableException.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 ?body:(Some pipe)
            ?cacheControl:(Option.map
                             ((List.Assoc.find ~equal:String.Caseless.equal)
                                xs "Cache-Control")
                             ~f:StringPrimitive.of_string)
            ?contentRange:(Option.map
                             ((List.Assoc.find ~equal:String.Caseless.equal)
                                xs "Content-Range")
                             ~f:ContentRangePattern.of_string)
            ?contentLength:(Option.map
                              ((List.Assoc.find ~equal:String.Caseless.equal)
                                 xs "Content-Length")
                              ~f:NonNegativeLong.of_string)
            ?contentType:(Option.map
                            ((List.Assoc.find ~equal:String.Caseless.equal)
                               xs "Content-Type") ~f:ContentType.of_string)
            ?eTag:(Option.map
                     ((List.Assoc.find ~equal:String.Caseless.equal) xs
                        "ETag") ~f:ETag.of_string)
            ?lastModified:(Option.map
                             ((List.Assoc.find ~equal:String.Caseless.equal)
                                xs "Last-Modified") ~f:TimeStamp.of_string)
            ?statusCode:(Option.map
                           ((List.Assoc.find ~equal:String.Caseless.equal) xs
                              "statuscode") ~f:StatusCode.of_string) ())
      [@warning "-27"])
    let to_value x =
      structure_to_value
        [("Body", (Option.map x.body ~f:PayloadBlob.to_value));
        ("Cache-Control",
          (Option.map x.cacheControl ~f:StringPrimitive.to_value));
        ("Content-Range",
          (Option.map x.contentRange ~f:ContentRangePattern.to_value));
        ("Content-Length",
          (Option.map x.contentLength ~f:NonNegativeLong.to_value));
        ("Content-Type", (Option.map x.contentType ~f:ContentType.to_value));
        ("ETag", (Option.map x.eTag ~f:ETag.to_value));
        ("Last-Modified", (Option.map x.lastModified ~f:TimeStamp.to_value));
        ("StatusCode", (Option.map x.statusCode ~f:StatusCode.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let statusCode =
        (Option.map ~f:StatusCode.of_xml) (Xml.child xml_arg0 "StatusCode") in
      let lastModified =
        (Option.map ~f:TimeStamp.of_xml) (Xml.child xml_arg0 "Last-Modified") in
      let eTag = (Option.map ~f:ETag.of_xml) (Xml.child xml_arg0 "ETag") in
      let contentType =
        (Option.map ~f:ContentType.of_xml)
          (Xml.child xml_arg0 "Content-Type") in
      let contentLength =
        (Option.map ~f:NonNegativeLong.of_xml)
          (Xml.child xml_arg0 "Content-Length") in
      let contentRange =
        (Option.map ~f:ContentRangePattern.of_xml)
          (Xml.child xml_arg0 "Content-Range") in
      let cacheControl =
        (Option.map ~f:StringPrimitive.of_xml)
          (Xml.child xml_arg0 "Cache-Control") in
      let body =
        (Option.map ~f:PayloadBlob.of_xml) (Xml.child xml_arg0 "Body") in
      make ?statusCode ?lastModified ?eTag ?contentType ?contentLength
        ?contentRange ?cacheControl ?body ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let statusCode = field_map json__ "StatusCode" StatusCode.of_json in
      let lastModified = field_map json__ "LastModified" TimeStamp.of_json in
      let eTag = field_map json__ "ETag" ETag.of_json in
      let contentType = field_map json__ "ContentType" ContentType.of_json in
      let contentLength =
        field_map json__ "ContentLength" NonNegativeLong.of_json in
      let contentRange =
        field_map json__ "ContentRange" ContentRangePattern.of_json in
      let cacheControl =
        field_map json__ "CacheControl" StringPrimitive.of_json in
      let body = field_map json__ "Body" PayloadBlob.of_json in
      make ?statusCode ?lastModified ?eTag ?contentType ?contentLength
        ?contentRange ?cacheControl ?body ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Downloads the object at the specified path. If the object\226\128\153s upload availability is set to streaming, AWS Elemental MediaStore downloads the object even if it\226\128\153s still uploading the object."]
module GetObjectRequest =
  struct
    type nonrec t =
      {
      path: PathNaming.t
        [@ocaml.doc
          "The path (including the file name) where the object is stored in the container. Format: <folder name>/<folder name>/<file name> For example, to upload the file mlaw.avi to the folder path premium\\canada in the container movies, enter the path premium/canada/mlaw.avi. Do not include the container name in this path. If the path includes any folders that don't exist yet, the service creates them. For example, suppose you have an existing premium/usa subfolder. If you specify premium/canada, the service creates a canada subfolder in the premium folder. You then have two subfolders, usa and canada, in the premium folder. There is no correlation between the path to the source and the path (folders) in the container in AWS Elemental MediaStore. For more information about folders and how they exist in a container, see the AWS Elemental MediaStore User Guide. The file name is the name that is assigned to the file that you upload. The file can have the same name inside and outside of AWS Elemental MediaStore, or it can have the same name. The file name can include or omit an extension."];
      range: RangePattern.t option
        [@ocaml.doc
          "The range bytes of an object to retrieve. For more information about the Range header, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. AWS Elemental MediaStore ignores this header for partially uploaded objects that have streaming upload availability."]}
    let context_ = "GetObjectRequest"
    let make ?range = fun ~path -> fun () -> { range; path }
    let to_value x =
      structure_to_value
        [("Path", (Some (PathNaming.to_value x.path)));
        ("Range", (Option.map x.range ~f:RangePattern.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let range =
        (Option.map ~f:RangePattern.of_xml) (Xml.child xml_arg0 "Range") in
      let path =
        PathNaming.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Path") in
      make ?range ~path ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let range = field_map json__ "Range" RangePattern.of_json in
      let path = field_map_exn json__ "Path" PathNaming.of_json in
      make ?range ~path ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Downloads the object at the specified path. If the object\226\128\153s upload availability is set to streaming, AWS Elemental MediaStore downloads the object even if it\226\128\153s still uploading the object."]
module DescribeObjectResponse =
  struct
    type nonrec t =
      {
      eTag: ETag.t option
        [@ocaml.doc
          "The ETag that represents a unique instance of the object."];
      contentType: ContentType.t option
        [@ocaml.doc "The content type of the object."];
      contentLength: NonNegativeLong.t option
        [@ocaml.doc "The length of the object in bytes."];
      cacheControl: StringPrimitive.t option
        [@ocaml.doc
          "An optional CacheControl header that allows the caller to control the object's cache behavior. Headers can be passed in as specified in the HTTP at https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9. Headers with a custom user-defined value are also accepted."];
      lastModified: TimeStamp.t option
        [@ocaml.doc "The date and time that the object was last modified."]}
    type nonrec error =
      [ `ContainerNotFoundException of ContainerNotFoundException.t 
      | `InternalServerError of InternalServerError.t 
      | `ObjectNotFoundException of ObjectNotFoundException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make ?eTag =
      fun ?contentType ->
        fun ?contentLength ->
          fun ?cacheControl ->
            fun ?lastModified ->
              fun () ->
                {
                  eTag;
                  contentType;
                  contentLength;
                  cacheControl;
                  lastModified
                }
    let error_of_json name json =
      match name with
      | "ContainerNotFoundException" ->
          `ContainerNotFoundException
            (ContainerNotFoundException.of_json json)
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_json json)
      | "ObjectNotFoundException" ->
          `ObjectNotFoundException (ObjectNotFoundException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "ContainerNotFoundException" ->
          `ContainerNotFoundException (ContainerNotFoundException.of_xml xml)
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_xml xml)
      | "ObjectNotFoundException" ->
          `ObjectNotFoundException (ObjectNotFoundException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `ContainerNotFoundException e ->
          `Assoc
            [("error", (`String "ContainerNotFoundException"));
            ("details", (ContainerNotFoundException.to_json e))]
      | `InternalServerError e ->
          `Assoc
            [("error", (`String "InternalServerError"));
            ("details", (InternalServerError.to_json e))]
      | `ObjectNotFoundException e ->
          `Assoc
            [("error", (`String "ObjectNotFoundException"));
            ("details", (ObjectNotFoundException.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
            ?eTag:(Option.map
                     ((List.Assoc.find ~equal:String.Caseless.equal) xs
                        "ETag") ~f:ETag.of_string)
            ?contentType:(Option.map
                            ((List.Assoc.find ~equal:String.Caseless.equal)
                               xs "Content-Type") ~f:ContentType.of_string)
            ?contentLength:(Option.map
                              ((List.Assoc.find ~equal:String.Caseless.equal)
                                 xs "Content-Length")
                              ~f:NonNegativeLong.of_string)
            ?cacheControl:(Option.map
                             ((List.Assoc.find ~equal:String.Caseless.equal)
                                xs "Cache-Control")
                             ~f:StringPrimitive.of_string)
            ?lastModified:(Option.map
                             ((List.Assoc.find ~equal:String.Caseless.equal)
                                xs "Last-Modified") ~f:TimeStamp.of_string)
            ())
      [@warning "-27"])
    let to_value x =
      structure_to_value
        [("ETag", (Option.map x.eTag ~f:ETag.to_value));
        ("Content-Type", (Option.map x.contentType ~f:ContentType.to_value));
        ("Content-Length",
          (Option.map x.contentLength ~f:NonNegativeLong.to_value));
        ("Cache-Control",
          (Option.map x.cacheControl ~f:StringPrimitive.to_value));
        ("Last-Modified", (Option.map x.lastModified ~f:TimeStamp.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let lastModified =
        (Option.map ~f:TimeStamp.of_xml) (Xml.child xml_arg0 "Last-Modified") in
      let cacheControl =
        (Option.map ~f:StringPrimitive.of_xml)
          (Xml.child xml_arg0 "Cache-Control") in
      let contentLength =
        (Option.map ~f:NonNegativeLong.of_xml)
          (Xml.child xml_arg0 "Content-Length") in
      let contentType =
        (Option.map ~f:ContentType.of_xml)
          (Xml.child xml_arg0 "Content-Type") in
      let eTag = (Option.map ~f:ETag.of_xml) (Xml.child xml_arg0 "ETag") in
      make ?lastModified ?cacheControl ?contentLength ?contentType ?eTag ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let lastModified = field_map json__ "LastModified" TimeStamp.of_json in
      let cacheControl =
        field_map json__ "CacheControl" StringPrimitive.of_json in
      let contentLength =
        field_map json__ "ContentLength" NonNegativeLong.of_json in
      let contentType = field_map json__ "ContentType" ContentType.of_json in
      let eTag = field_map json__ "ETag" ETag.of_json in
      make ?lastModified ?cacheControl ?contentLength ?contentType ?eTag ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Gets the headers for an object at the specified path."]
module DescribeObjectRequest =
  struct
    type nonrec t =
      {
      path: PathNaming.t
        [@ocaml.doc
          "The path (including the file name) where the object is stored in the container. Format: <folder name>/<folder name>/<file name>"]}
    let context_ = "DescribeObjectRequest"
    let make ~path = fun () -> { path }
    let to_value x =
      structure_to_value [("Path", (Some (PathNaming.to_value x.path)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let path =
        PathNaming.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Path") in
      make ~path ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let path = field_map_exn json__ "Path" PathNaming.of_json in
      make ~path ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Gets the headers for an object at the specified path."]
module DeleteObjectResponse =
  struct
    type nonrec t = unit
    type nonrec error =
      [ `ContainerNotFoundException of ContainerNotFoundException.t 
      | `InternalServerError of InternalServerError.t 
      | `ObjectNotFoundException of ObjectNotFoundException.t 
      | `Unknown_operation_error of (string * string option) ]
    let make () = ()
    let error_of_json name json =
      match name with
      | "ContainerNotFoundException" ->
          `ContainerNotFoundException
            (ContainerNotFoundException.of_json json)
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_json json)
      | "ObjectNotFoundException" ->
          `ObjectNotFoundException (ObjectNotFoundException.of_json json)
      | name ->
          `Unknown_operation_error
            (name, (Some (Yojson.Safe.to_string json)))
    let error_of_xml name xml =
      match name with
      | "ContainerNotFoundException" ->
          `ContainerNotFoundException (ContainerNotFoundException.of_xml xml)
      | "InternalServerError" ->
          `InternalServerError (InternalServerError.of_xml xml)
      | "ObjectNotFoundException" ->
          `ObjectNotFoundException (ObjectNotFoundException.of_xml xml)
      | name ->
          `Unknown_operation_error (name, (Some (Awso.Xml.to_string xml)))
    let error_to_json : error -> Yojson.Safe.t =
      function
      | `ContainerNotFoundException e ->
          `Assoc
            [("error", (`String "ContainerNotFoundException"));
            ("details", (ContainerNotFoundException.to_json e))]
      | `InternalServerError e ->
          `Assoc
            [("error", (`String "InternalServerError"));
            ("details", (InternalServerError.to_json e))]
      | `ObjectNotFoundException e ->
          `Assoc
            [("error", (`String "ObjectNotFoundException"));
            ("details", (ObjectNotFoundException.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 "Deletes an object at the specified path."]
module DeleteObjectRequest =
  struct
    type nonrec t =
      {
      path: PathNaming.t
        [@ocaml.doc
          "The path (including the file name) where the object is stored in the container. Format: <folder name>/<folder name>/<file name>"]}
    let context_ = "DeleteObjectRequest"
    let make ~path = fun () -> { path }
    let to_value x =
      structure_to_value [("Path", (Some (PathNaming.to_value x.path)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let path =
        PathNaming.of_xml (Xml.child_exn ~context:context_ xml_arg0 "Path") in
      make ~path ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let path = field_map_exn json__ "Path" PathNaming.of_json in
      make ~path ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "Deletes an object at the specified path."]