package smaws-clients

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file serializers.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
open Smaws_Lib.Json.SerializeHelpers

open Types

let error_message_to_yojson = string_to_yojson

let trimmed_data_access_exception_to_yojson = 
  fun (x: trimmed_data_access_exception) -> assoc_to_yojson(
    [(
         "message",
         (option_to_yojson error_message_to_yojson x.message));
       
  ])

let table_name_to_yojson = string_to_yojson

let string_attribute_value_to_yojson = string_to_yojson

let string_set_attribute_value_to_yojson = 
  fun tree -> list_to_yojson string_attribute_value_to_yojson tree

let string__to_yojson = string_to_yojson

let base_unit_to_yojson = unit_to_yojson

let stream_view_type_to_yojson = 
  fun (x: stream_view_type) -> match x with 
 
| KEYS_ONLY -> `String "KEYS_ONLY"
  | NEW_AND_OLD_IMAGES -> `String "NEW_AND_OLD_IMAGES"
  | OLD_IMAGE -> `String "OLD_IMAGE"
  | NEW_IMAGE -> `String "NEW_IMAGE"
   

let stream_status_to_yojson = 
  fun (x: stream_status) -> match x with 
 
| DISABLED -> `String "DISABLED"
  | DISABLING -> `String "DISABLING"
  | ENABLED -> `String "ENABLED"
  | ENABLING -> `String "ENABLING"
   

let date_to_yojson = timestamp_to_yojson

let number_attribute_value_to_yojson = string_to_yojson

let binary_attribute_value_to_yojson = blob_to_yojson

let number_set_attribute_value_to_yojson = 
  fun tree -> list_to_yojson number_attribute_value_to_yojson tree

let binary_set_attribute_value_to_yojson = 
  fun tree -> list_to_yojson binary_attribute_value_to_yojson tree

let attribute_name_to_yojson = string_to_yojson

let null_attribute_value_to_yojson = bool_to_yojson

let boolean_attribute_value_to_yojson = bool_to_yojson

let rec attribute_value_to_yojson = 
  fun (x: attribute_value) -> 
  match x with 
    | BOOL(arg) -> assoc_to_yojson ["BOOL", Some (boolean_attribute_value_to_yojson arg)]
      | NULL(arg) -> assoc_to_yojson ["NULL", Some (null_attribute_value_to_yojson arg)]
      | L(arg) -> assoc_to_yojson ["L", Some (list_attribute_value_to_yojson arg)]
      | M(arg) -> assoc_to_yojson ["M", Some (map_attribute_value_to_yojson arg)]
      | BS(arg) -> assoc_to_yojson ["BS", Some (binary_set_attribute_value_to_yojson arg)]
      | NS(arg) -> assoc_to_yojson ["NS", Some (number_set_attribute_value_to_yojson arg)]
      | SS(arg) -> assoc_to_yojson ["SS", Some (string_set_attribute_value_to_yojson arg)]
      | B(arg) -> assoc_to_yojson ["B", Some (binary_attribute_value_to_yojson arg)]
      | N(arg) -> assoc_to_yojson ["N", Some (number_attribute_value_to_yojson arg)]
      | S(arg) -> assoc_to_yojson ["S", Some (string_attribute_value_to_yojson arg)]
      
      
    

and list_attribute_value_to_yojson = 
  fun tree -> list_to_yojson attribute_value_to_yojson tree

and map_attribute_value_to_yojson = 
  fun tree -> map_to_yojson attribute_value_to_yojson tree

let attribute_map_to_yojson = 
  fun tree -> map_to_yojson attribute_value_to_yojson tree

let sequence_number_to_yojson = string_to_yojson

let positive_long_object_to_yojson = long_to_yojson

let stream_record_to_yojson = 
  fun (x: stream_record) -> assoc_to_yojson(
    [(
         "StreamViewType",
         (option_to_yojson stream_view_type_to_yojson x.stream_view_type));
       (
         "SizeBytes",
         (option_to_yojson positive_long_object_to_yojson x.size_bytes));
       (
         "SequenceNumber",
         (option_to_yojson sequence_number_to_yojson x.sequence_number));
       (
         "OldImage",
         (option_to_yojson attribute_map_to_yojson x.old_image));
       (
         "NewImage",
         (option_to_yojson attribute_map_to_yojson x.new_image));
       (
         "Keys",
         (option_to_yojson attribute_map_to_yojson x.keys));
       (
         "ApproximateCreationDateTime",
         (option_to_yojson date_to_yojson x.approximate_creation_date_time));
       
  ])

let stream_arn_to_yojson = string_to_yojson

let stream_to_yojson = 
  fun (x: stream) -> assoc_to_yojson(
    [(
         "StreamLabel",
         (option_to_yojson string__to_yojson x.stream_label));
       (
         "TableName",
         (option_to_yojson table_name_to_yojson x.table_name));
       (
         "StreamArn",
         (option_to_yojson stream_arn_to_yojson x.stream_arn));
       
  ])

let stream_list_to_yojson = 
  fun tree -> list_to_yojson stream_to_yojson tree

let key_schema_attribute_name_to_yojson = string_to_yojson

let key_type_to_yojson = 
  fun (x: key_type) -> match x with 
  | RANGE -> `String "RANGE"
    | HASH -> `String "HASH"
     

let key_schema_element_to_yojson = 
  fun (x: key_schema_element) -> assoc_to_yojson(
    [(
         "KeyType",
         (Some (key_type_to_yojson x.key_type)));
       (
         "AttributeName",
         (Some (key_schema_attribute_name_to_yojson x.attribute_name)));
       
  ])

let key_schema_to_yojson = 
  fun tree -> list_to_yojson key_schema_element_to_yojson tree

let shard_id_to_yojson = string_to_yojson

let sequence_number_range_to_yojson = 
  fun (x: sequence_number_range) -> assoc_to_yojson(
    [(
         "EndingSequenceNumber",
         (option_to_yojson sequence_number_to_yojson x.ending_sequence_number));
       (
         "StartingSequenceNumber",
         (option_to_yojson sequence_number_to_yojson x.starting_sequence_number));
       
  ])

let shard_to_yojson = 
  fun (x: shard) -> assoc_to_yojson(
    [(
         "ParentShardId",
         (option_to_yojson shard_id_to_yojson x.parent_shard_id));
       (
         "SequenceNumberRange",
         (option_to_yojson sequence_number_range_to_yojson x.sequence_number_range));
       (
         "ShardId",
         (option_to_yojson shard_id_to_yojson x.shard_id));
       
  ])

let shard_description_list_to_yojson = 
  fun tree -> list_to_yojson shard_to_yojson tree

let stream_description_to_yojson = 
  fun (x: stream_description) -> assoc_to_yojson(
    [(
         "LastEvaluatedShardId",
         (option_to_yojson shard_id_to_yojson x.last_evaluated_shard_id));
       (
         "Shards",
         (option_to_yojson shard_description_list_to_yojson x.shards));
       (
         "KeySchema",
         (option_to_yojson key_schema_to_yojson x.key_schema));
       (
         "TableName",
         (option_to_yojson table_name_to_yojson x.table_name));
       (
         "CreationRequestDateTime",
         (option_to_yojson date_to_yojson x.creation_request_date_time));
       (
         "StreamViewType",
         (option_to_yojson stream_view_type_to_yojson x.stream_view_type));
       (
         "StreamStatus",
         (option_to_yojson stream_status_to_yojson x.stream_status));
       (
         "StreamLabel",
         (option_to_yojson string__to_yojson x.stream_label));
       (
         "StreamArn",
         (option_to_yojson stream_arn_to_yojson x.stream_arn));
       
  ])

let shard_iterator_type_to_yojson = 
  fun (x: shard_iterator_type) -> match x with 
 
| AFTER_SEQUENCE_NUMBER -> `String "AFTER_SEQUENCE_NUMBER"
  | AT_SEQUENCE_NUMBER -> `String "AT_SEQUENCE_NUMBER"
  | LATEST -> `String "LATEST"
  | TRIM_HORIZON -> `String "TRIM_HORIZON"
   

let shard_iterator_to_yojson = string_to_yojson

let resource_not_found_exception_to_yojson = 
  fun (x: resource_not_found_exception) -> assoc_to_yojson(
    [(
         "message",
         (option_to_yojson error_message_to_yojson x.message));
       
  ])

let operation_type_to_yojson = 
  fun (x: operation_type) -> match x with 
 
| REMOVE -> `String "REMOVE"
  | MODIFY -> `String "MODIFY"
  | INSERT -> `String "INSERT"
   

let identity_to_yojson = 
  fun (x: identity) -> assoc_to_yojson(
    [(
         "Type",
         (option_to_yojson string__to_yojson x.type_));
       (
         "PrincipalId",
         (option_to_yojson string__to_yojson x.principal_id));
       
  ])

let record_to_yojson = 
  fun (x: record) -> assoc_to_yojson(
    [(
         "userIdentity",
         (option_to_yojson identity_to_yojson x.user_identity));
       (
         "dynamodb",
         (option_to_yojson stream_record_to_yojson x.dynamodb));
       (
         "awsRegion",
         (option_to_yojson string__to_yojson x.aws_region));
       (
         "eventSource",
         (option_to_yojson string__to_yojson x.event_source));
       (
         "eventVersion",
         (option_to_yojson string__to_yojson x.event_version));
       (
         "eventName",
         (option_to_yojson operation_type_to_yojson x.event_name));
       (
         "eventID",
         (option_to_yojson string__to_yojson x.event_i_d));
       
  ])

let record_list_to_yojson = 
  fun tree -> list_to_yojson record_to_yojson tree

let positive_integer_object_to_yojson = int_to_yojson

let list_streams_output_to_yojson = 
  fun (x: list_streams_output) -> assoc_to_yojson(
    [(
         "LastEvaluatedStreamArn",
         (option_to_yojson stream_arn_to_yojson x.last_evaluated_stream_arn));
       (
         "Streams",
         (option_to_yojson stream_list_to_yojson x.streams));
       
  ])

let list_streams_input_to_yojson = 
  fun (x: list_streams_input) -> assoc_to_yojson(
    [(
         "ExclusiveStartStreamArn",
         (option_to_yojson stream_arn_to_yojson x.exclusive_start_stream_arn));
       (
         "Limit",
         (option_to_yojson positive_integer_object_to_yojson x.limit));
       (
         "TableName",
         (option_to_yojson table_name_to_yojson x.table_name));
       
  ])

let internal_server_error_to_yojson = 
  fun (x: internal_server_error) -> assoc_to_yojson(
    [(
         "message",
         (option_to_yojson error_message_to_yojson x.message));
       
  ])

let limit_exceeded_exception_to_yojson = 
  fun (x: limit_exceeded_exception) -> assoc_to_yojson(
    [(
         "message",
         (option_to_yojson error_message_to_yojson x.message));
       
  ])

let get_shard_iterator_output_to_yojson = 
  fun (x: get_shard_iterator_output) -> assoc_to_yojson(
    [(
         "ShardIterator",
         (option_to_yojson shard_iterator_to_yojson x.shard_iterator));
       
  ])

let get_shard_iterator_input_to_yojson = 
  fun (x: get_shard_iterator_input) -> assoc_to_yojson(
    [(
         "SequenceNumber",
         (option_to_yojson sequence_number_to_yojson x.sequence_number));
       (
         "ShardIteratorType",
         (Some (shard_iterator_type_to_yojson x.shard_iterator_type)));
       (
         "ShardId",
         (Some (shard_id_to_yojson x.shard_id)));
       (
         "StreamArn",
         (Some (stream_arn_to_yojson x.stream_arn)));
       
  ])

let get_records_output_to_yojson = 
  fun (x: get_records_output) -> assoc_to_yojson(
    [(
         "NextShardIterator",
         (option_to_yojson shard_iterator_to_yojson x.next_shard_iterator));
       (
         "Records",
         (option_to_yojson record_list_to_yojson x.records));
       
  ])

let get_records_input_to_yojson = 
  fun (x: get_records_input) -> assoc_to_yojson(
    [(
         "Limit",
         (option_to_yojson positive_integer_object_to_yojson x.limit));
       (
         "ShardIterator",
         (Some (shard_iterator_to_yojson x.shard_iterator)));
       
  ])

let expired_iterator_exception_to_yojson = 
  fun (x: expired_iterator_exception) -> assoc_to_yojson(
    [(
         "message",
         (option_to_yojson error_message_to_yojson x.message));
       
  ])

let describe_stream_output_to_yojson = 
  fun (x: describe_stream_output) -> assoc_to_yojson(
    [(
         "StreamDescription",
         (option_to_yojson stream_description_to_yojson x.stream_description));
       
  ])

let describe_stream_input_to_yojson = 
  fun (x: describe_stream_input) -> assoc_to_yojson(
    [(
         "ExclusiveStartShardId",
         (option_to_yojson shard_id_to_yojson x.exclusive_start_shard_id));
       (
         "Limit",
         (option_to_yojson positive_integer_object_to_yojson x.limit));
       (
         "StreamArn",
         (Some (stream_arn_to_yojson x.stream_arn)));
       
  ])

let base_string_to_yojson = string_to_yojson

let base_boolean_to_yojson = bool_to_yojson

let base_integer_to_yojson = int_to_yojson

let base_timestamp_to_yojson = timestamp_to_yojson

let base_long_to_yojson = long_to_yojson

let base_document_to_yojson = 
  json_to_yojson

OCaml

Innovation. Community. Security.