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
open Core
open Async
let json_arg = Command.Arg_type.create Yojson.Safe.from_string
let call ?endpoint_url ?profile ?region f m result_to_json error_to_json =
let region =
match region with
| Some region -> Some (Awso.Region.of_string region)
| None -> None in
(Awso_async.Cfg.get_exn ?profile ?region ()) >>=
(fun cfg ->
(f ?endpoint_url ?cfg:(Some cfg) m) >>=
(fun result ->
match result with
| Error err ->
(match error_to_json with
| None ->
failwithf
"endpoint error, but no error values defined in boto"
()
| Some to_json ->
let s = (err |> to_json) |> Yojson.Safe.to_string in
failwithf "AWS error: %s" s ())
| Ok result ->
((match result_to_json with
| None -> print_endline "ok response from endpoint"
| Some to_json ->
((result |> to_json) |> Yojson.Safe.to_string) |>
print_endline);
return ())))
let create_capability =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and instructionsDocuments =
flag "instructions-documents" (optional json_arg)
~doc:"JSON InstructionsDocuments"
and clientToken =
flag "client-token" (optional string) ~doc:"STRING String"
and tags = flag "tags" (optional json_arg) ~doc:"JSON TagList"
and name = flag "name" (required string) ~doc:"STRING CapabilityName"
and type_ =
flag "type-" (required json_arg) ~doc:"JSON CapabilityType"
and configuration =
flag "configuration" (required json_arg)
~doc:"JSON CapabilityConfiguration" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.create_capability
(Values.CreateCapabilityRequest.make
?instructionsDocuments:(Option.map
~f:Values.InstructionsDocuments.of_json
instructionsDocuments) ?clientToken
?tags:(Option.map ~f:Values.TagList.of_json tags) ~name
~type_:(Values.CapabilityType.of_json type_)
~configuration:(Values.CapabilityConfiguration.of_json
configuration) ())
(Some Values.CreateCapabilityResponse.to_json)
(Some Values.CreateCapabilityResponse.error_to_json)])
let create_partnership =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and phone = flag "phone" (optional string) ~doc:"STRING Phone"
and capabilityOptions =
flag "capability-options" (optional json_arg)
~doc:"JSON CapabilityOptions"
and clientToken =
flag "client-token" (optional string) ~doc:"STRING String"
and tags = flag "tags" (optional json_arg) ~doc:"JSON TagList"
and profileId =
flag "profile-id" (required string) ~doc:"STRING ProfileId"
and name = flag "name" (required string) ~doc:"STRING PartnerName"
and email = flag "email" (required string) ~doc:"STRING Email"
and capabilities =
flag "capabilities" (required json_arg)
~doc:"JSON PartnershipCapabilities" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.create_partnership
(Values.CreatePartnershipRequest.make ?phone
?capabilityOptions:(Option.map
~f:Values.CapabilityOptions.of_json
capabilityOptions) ?clientToken
?tags:(Option.map ~f:Values.TagList.of_json tags) ~profileId
~name ~email
~capabilities:(Values.PartnershipCapabilities.of_json
capabilities) ())
(Some Values.CreatePartnershipResponse.to_json)
(Some Values.CreatePartnershipResponse.error_to_json)])
let create_profile =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and email = flag "email" (optional string) ~doc:"STRING Email"
and clientToken =
flag "client-token" (optional string) ~doc:"STRING String"
and tags = flag "tags" (optional json_arg) ~doc:"JSON TagList"
and name = flag "name" (required string) ~doc:"STRING ProfileName"
and phone = flag "phone" (required string) ~doc:"STRING Phone"
and businessName =
flag "business-name" (required string) ~doc:"STRING BusinessName"
and logging = flag "logging" (required json_arg) ~doc:"JSON Logging" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.create_profile
(Values.CreateProfileRequest.make ?email ?clientToken
?tags:(Option.map ~f:Values.TagList.of_json tags) ~name ~phone
~businessName ~logging:(Values.Logging.of_json logging) ())
(Some Values.CreateProfileResponse.to_json)
(Some Values.CreateProfileResponse.error_to_json)])
let create_starter_mapping_template =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and outputSampleLocation =
flag "output-sample-location" (optional json_arg)
~doc:"JSON S3Location"
and mappingType =
flag "mapping-type" (required json_arg) ~doc:"JSON MappingType"
and templateDetails =
flag "template-details" (required json_arg)
~doc:"JSON TemplateDetails" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.create_starter_mapping_template
(Values.CreateStarterMappingTemplateRequest.make
?outputSampleLocation:(Option.map ~f:Values.S3Location.of_json
outputSampleLocation)
~mappingType:(Values.MappingType.of_json mappingType)
~templateDetails:(Values.TemplateDetails.of_json
templateDetails) ())
(Some Values.CreateStarterMappingTemplateResponse.to_json)
(Some Values.CreateStarterMappingTemplateResponse.error_to_json)])
let create_transformer =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and clientToken =
flag "client-token" (optional string) ~doc:"STRING String"
and tags = flag "tags" (optional json_arg) ~doc:"JSON TagList"
and fileFormat =
flag "file-format" (optional json_arg) ~doc:"JSON FileFormat"
and mappingTemplate =
flag "mapping-template" (optional string)
~doc:"STRING MappingTemplate"
and ediType = flag "edi-type" (optional json_arg) ~doc:"JSON EdiType"
and sampleDocument =
flag "sample-document" (optional string) ~doc:"STRING FileLocation"
and inputConversion =
flag "input-conversion" (optional json_arg)
~doc:"JSON InputConversion"
and mapping = flag "mapping" (optional json_arg) ~doc:"JSON Mapping"
and outputConversion =
flag "output-conversion" (optional json_arg)
~doc:"JSON OutputConversion"
and sampleDocuments =
flag "sample-documents" (optional json_arg)
~doc:"JSON SampleDocuments"
and name = flag "name" (required string) ~doc:"STRING TransformerName" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.create_transformer
(Values.CreateTransformerRequest.make ?clientToken
?tags:(Option.map ~f:Values.TagList.of_json tags)
?fileFormat:(Option.map ~f:Values.FileFormat.of_json fileFormat)
?mappingTemplate
?ediType:(Option.map ~f:Values.EdiType.of_json ediType)
?sampleDocument
?inputConversion:(Option.map ~f:Values.InputConversion.of_json
inputConversion)
?mapping:(Option.map ~f:Values.Mapping.of_json mapping)
?outputConversion:(Option.map
~f:Values.OutputConversion.of_json
outputConversion)
?sampleDocuments:(Option.map ~f:Values.SampleDocuments.of_json
sampleDocuments) ~name ())
(Some Values.CreateTransformerResponse.to_json)
(Some Values.CreateTransformerResponse.error_to_json)])
let delete_capability =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and capabilityId =
flag "capability-id" (required string) ~doc:"STRING CapabilityId" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.delete_capability
(Values.DeleteCapabilityRequest.make ~capabilityId ()) None None])
let delete_partnership =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and partnershipId =
flag "partnership-id" (required string) ~doc:"STRING PartnershipId" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.delete_partnership
(Values.DeletePartnershipRequest.make ~partnershipId ()) None None])
let delete_profile =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and profileId =
flag "profile-id" (required string) ~doc:"STRING ProfileId" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.delete_profile (Values.DeleteProfileRequest.make ~profileId ())
None None])
let delete_transformer =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and transformerId =
flag "transformer-id" (required string) ~doc:"STRING TransformerId" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.delete_transformer
(Values.DeleteTransformerRequest.make ~transformerId ()) None None])
let generate_mapping =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and inputFileContent =
flag "input-file-content" (required string)
~doc:"STRING GenerateMappingInputFileContent"
and outputFileContent =
flag "output-file-content" (required string)
~doc:"STRING GenerateMappingOutputFileContent"
and mappingType =
flag "mapping-type" (required json_arg) ~doc:"JSON MappingType" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.generate_mapping
(Values.GenerateMappingRequest.make ~inputFileContent
~outputFileContent
~mappingType:(Values.MappingType.of_json mappingType) ())
(Some Values.GenerateMappingResponse.to_json)
(Some Values.GenerateMappingResponse.error_to_json)])
let get_capability =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and capabilityId =
flag "capability-id" (required string) ~doc:"STRING CapabilityId" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.get_capability
(Values.GetCapabilityRequest.make ~capabilityId ())
(Some Values.GetCapabilityResponse.to_json)
(Some Values.GetCapabilityResponse.error_to_json)])
let get_partnership =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and partnershipId =
flag "partnership-id" (required string) ~doc:"STRING PartnershipId" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.get_partnership
(Values.GetPartnershipRequest.make ~partnershipId ())
(Some Values.GetPartnershipResponse.to_json)
(Some Values.GetPartnershipResponse.error_to_json)])
let get_profile =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and profileId =
flag "profile-id" (required string) ~doc:"STRING ProfileId" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.get_profile (Values.GetProfileRequest.make ~profileId ())
(Some Values.GetProfileResponse.to_json)
(Some Values.GetProfileResponse.error_to_json)])
let get_transformer =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and transformerId =
flag "transformer-id" (required string) ~doc:"STRING TransformerId" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.get_transformer
(Values.GetTransformerRequest.make ~transformerId ())
(Some Values.GetTransformerResponse.to_json)
(Some Values.GetTransformerResponse.error_to_json)])
let get_transformer_job =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and transformerJobId =
flag "transformer-job-id" (required string)
~doc:"STRING TransformerJobId"
and transformerId =
flag "transformer-id" (required string) ~doc:"STRING TransformerId" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.get_transformer_job
(Values.GetTransformerJobRequest.make ~transformerJobId
~transformerId ())
(Some Values.GetTransformerJobResponse.to_json)
(Some Values.GetTransformerJobResponse.error_to_json)])
let list_capabilities =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and nextToken =
flag "next-token" (optional string) ~doc:"STRING PageToken"
and maxResults =
flag "max-results" (optional int) ~doc:"INT MaxResults" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.list_capabilities
(Values.ListCapabilitiesRequest.make ?nextToken ?maxResults ())
(Some Values.ListCapabilitiesResponse.to_json)
(Some Values.ListCapabilitiesResponse.error_to_json)])
let list_partnerships =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and profileId =
flag "profile-id" (optional string) ~doc:"STRING ProfileId"
and nextToken =
flag "next-token" (optional string) ~doc:"STRING PageToken"
and maxResults =
flag "max-results" (optional int) ~doc:"INT MaxResults" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.list_partnerships
(Values.ListPartnershipsRequest.make ?profileId ?nextToken
?maxResults ()) (Some Values.ListPartnershipsResponse.to_json)
(Some Values.ListPartnershipsResponse.error_to_json)])
let list_profiles =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and nextToken =
flag "next-token" (optional string) ~doc:"STRING PageToken"
and maxResults =
flag "max-results" (optional int) ~doc:"INT MaxResults" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.list_profiles
(Values.ListProfilesRequest.make ?nextToken ?maxResults ())
(Some Values.ListProfilesResponse.to_json)
(Some Values.ListProfilesResponse.error_to_json)])
let list_tags_for_resource =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and resourceARN =
flag "resource-a-r-n" (required string)
~doc:"STRING AmazonResourceName" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.list_tags_for_resource
(Values.ListTagsForResourceRequest.make ~resourceARN ())
(Some Values.ListTagsForResourceResponse.to_json)
(Some Values.ListTagsForResourceResponse.error_to_json)])
let list_transformers =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and nextToken =
flag "next-token" (optional string) ~doc:"STRING PageToken"
and maxResults =
flag "max-results" (optional int) ~doc:"INT MaxResults" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.list_transformers
(Values.ListTransformersRequest.make ?nextToken ?maxResults ())
(Some Values.ListTransformersResponse.to_json)
(Some Values.ListTransformersResponse.error_to_json)])
let start_transformer_job =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and clientToken =
flag "client-token" (optional string) ~doc:"STRING String"
and inputFile =
flag "input-file" (required json_arg) ~doc:"JSON S3Location"
and outputLocation =
flag "output-location" (required json_arg) ~doc:"JSON S3Location"
and transformerId =
flag "transformer-id" (required string) ~doc:"STRING TransformerId" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.start_transformer_job
(Values.StartTransformerJobRequest.make ?clientToken
~inputFile:(Values.S3Location.of_json inputFile)
~outputLocation:(Values.S3Location.of_json outputLocation)
~transformerId ())
(Some Values.StartTransformerJobResponse.to_json)
(Some Values.StartTransformerJobResponse.error_to_json)])
let tag_resource =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and resourceARN =
flag "resource-a-r-n" (required string)
~doc:"STRING AmazonResourceName"
and tags = flag "tags" (required json_arg) ~doc:"JSON TagList" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.tag_resource
(Values.TagResourceRequest.make ~resourceARN
~tags:(Values.TagList.of_json tags) ()) None None])
let test_conversion =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and source =
flag "source" (required json_arg) ~doc:"JSON ConversionSource"
and target =
flag "target" (required json_arg) ~doc:"JSON ConversionTarget" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.test_conversion
(Values.TestConversionRequest.make
~source:(Values.ConversionSource.of_json source)
~target:(Values.ConversionTarget.of_json target) ())
(Some Values.TestConversionResponse.to_json)
(Some Values.TestConversionResponse.error_to_json)])
let test_mapping =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and inputFileContent =
flag "input-file-content" (required string)
~doc:"STRING TestMappingInputFileContent"
and mappingTemplate =
flag "mapping-template" (required string)
~doc:"STRING MappingTemplate"
and fileFormat =
flag "file-format" (required json_arg) ~doc:"JSON FileFormat" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.test_mapping
(Values.TestMappingRequest.make ~inputFileContent ~mappingTemplate
~fileFormat:(Values.FileFormat.of_json fileFormat) ())
(Some Values.TestMappingResponse.to_json)
(Some Values.TestMappingResponse.error_to_json)])
let test_parsing =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and advancedOptions =
flag "advanced-options" (optional json_arg)
~doc:"JSON AdvancedOptions"
and inputFile =
flag "input-file" (required json_arg) ~doc:"JSON S3Location"
and fileFormat =
flag "file-format" (required json_arg) ~doc:"JSON FileFormat"
and ediType = flag "edi-type" (required json_arg) ~doc:"JSON EdiType" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.test_parsing
(Values.TestParsingRequest.make
?advancedOptions:(Option.map ~f:Values.AdvancedOptions.of_json
advancedOptions)
~inputFile:(Values.S3Location.of_json inputFile)
~fileFormat:(Values.FileFormat.of_json fileFormat)
~ediType:(Values.EdiType.of_json ediType) ())
(Some Values.TestParsingResponse.to_json)
(Some Values.TestParsingResponse.error_to_json)])
let untag_resource =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and resourceARN =
flag "resource-a-r-n" (required string)
~doc:"STRING AmazonResourceName"
and tagKeys =
flag "tag-keys" (required json_arg) ~doc:"JSON TagKeyList" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.untag_resource
(Values.UntagResourceRequest.make ~resourceARN
~tagKeys:(Values.TagKeyList.of_json tagKeys) ()) None None])
let update_capability =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and name = flag "name" (optional string) ~doc:"STRING CapabilityName"
and configuration =
flag "configuration" (optional json_arg)
~doc:"JSON CapabilityConfiguration"
and instructionsDocuments =
flag "instructions-documents" (optional json_arg)
~doc:"JSON InstructionsDocuments"
and capabilityId =
flag "capability-id" (required string) ~doc:"STRING CapabilityId" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.update_capability
(Values.UpdateCapabilityRequest.make ?name
?configuration:(Option.map
~f:Values.CapabilityConfiguration.of_json
configuration)
?instructionsDocuments:(Option.map
~f:Values.InstructionsDocuments.of_json
instructionsDocuments) ~capabilityId
()) (Some Values.UpdateCapabilityResponse.to_json)
(Some Values.UpdateCapabilityResponse.error_to_json)])
let update_partnership =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and name = flag "name" (optional string) ~doc:"STRING PartnerName"
and capabilities =
flag "capabilities" (optional json_arg)
~doc:"JSON PartnershipCapabilities"
and capabilityOptions =
flag "capability-options" (optional json_arg)
~doc:"JSON CapabilityOptions"
and partnershipId =
flag "partnership-id" (required string) ~doc:"STRING PartnershipId" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.update_partnership
(Values.UpdatePartnershipRequest.make ?name
?capabilities:(Option.map
~f:Values.PartnershipCapabilities.of_json
capabilities)
?capabilityOptions:(Option.map
~f:Values.CapabilityOptions.of_json
capabilityOptions) ~partnershipId ())
(Some Values.UpdatePartnershipResponse.to_json)
(Some Values.UpdatePartnershipResponse.error_to_json)])
let update_profile =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and name = flag "name" (optional string) ~doc:"STRING ProfileName"
and email = flag "email" (optional string) ~doc:"STRING Email"
and phone = flag "phone" (optional string) ~doc:"STRING Phone"
and businessName =
flag "business-name" (optional string) ~doc:"STRING BusinessName"
and profileId =
flag "profile-id" (required string) ~doc:"STRING ProfileId" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.update_profile
(Values.UpdateProfileRequest.make ?name ?email ?phone
?businessName ~profileId ())
(Some Values.UpdateProfileResponse.to_json)
(Some Values.UpdateProfileResponse.error_to_json)])
let update_transformer =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and name = flag "name" (optional string) ~doc:"STRING TransformerName"
and status =
flag "status" (optional json_arg) ~doc:"JSON TransformerStatus"
and fileFormat =
flag "file-format" (optional json_arg) ~doc:"JSON FileFormat"
and mappingTemplate =
flag "mapping-template" (optional string)
~doc:"STRING MappingTemplate"
and ediType = flag "edi-type" (optional json_arg) ~doc:"JSON EdiType"
and sampleDocument =
flag "sample-document" (optional string) ~doc:"STRING FileLocation"
and inputConversion =
flag "input-conversion" (optional json_arg)
~doc:"JSON InputConversion"
and mapping = flag "mapping" (optional json_arg) ~doc:"JSON Mapping"
and outputConversion =
flag "output-conversion" (optional json_arg)
~doc:"JSON OutputConversion"
and sampleDocuments =
flag "sample-documents" (optional json_arg)
~doc:"JSON SampleDocuments"
and transformerId =
flag "transformer-id" (required string) ~doc:"STRING TransformerId" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.update_transformer
(Values.UpdateTransformerRequest.make ?name
?status:(Option.map ~f:Values.TransformerStatus.of_json status)
?fileFormat:(Option.map ~f:Values.FileFormat.of_json fileFormat)
?mappingTemplate
?ediType:(Option.map ~f:Values.EdiType.of_json ediType)
?sampleDocument
?inputConversion:(Option.map ~f:Values.InputConversion.of_json
inputConversion)
?mapping:(Option.map ~f:Values.Mapping.of_json mapping)
?outputConversion:(Option.map
~f:Values.OutputConversion.of_json
outputConversion)
?sampleDocuments:(Option.map ~f:Values.SampleDocuments.of_json
sampleDocuments) ~transformerId ())
(Some Values.UpdateTransformerResponse.to_json)
(Some Values.UpdateTransformerResponse.error_to_json)])
let main =
Command.group
~summary:((Awso.Service.to_string Values.service) ^ " commands")
[("create-capability", create_capability);
("create-partnership", create_partnership);
("create-profile", create_profile);
("create-starter-mapping-template", create_starter_mapping_template);
("create-transformer", create_transformer);
("delete-capability", delete_capability);
("delete-partnership", delete_partnership);
("delete-profile", delete_profile);
("delete-transformer", delete_transformer);
("generate-mapping", generate_mapping);
("get-capability", get_capability);
("get-partnership", get_partnership);
("get-profile", get_profile);
("get-transformer", get_transformer);
("get-transformer-job", get_transformer_job);
("list-capabilities", list_capabilities);
("list-partnerships", list_partnerships);
("list-profiles", list_profiles);
("list-tags-for-resource", list_tags_for_resource);
("list-transformers", list_transformers);
("start-transformer-job", start_transformer_job);
("tag-resource", tag_resource);
("test-conversion", test_conversion);
("test-mapping", test_mapping);
("test-parsing", test_parsing);
("untag-resource", untag_resource);
("update-capability", update_capability);
("update-partnership", update_partnership);
("update-profile", update_profile);
("update-transformer", update_transformer)]