Source file struct.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
[@@@ocaml.alert "-protobuf"]
(**/**)
module Runtime' = Ocaml_protoc_plugin [@@warning "-33"]
module Imported'modules = struct
end
(**/**)
module rec Google : sig
module rec Protobuf : sig
(**
`NullValue` is a singleton enumeration to represent the null value for the
`Value` type union.
{v
The JSON representation for `NullValue` is JSON `null`.
v}
*)
module rec NullValue : sig
type t =
| NULL_VALUE
(** Null value. *)
val name: unit -> string
(** Fully qualified protobuf name of this enum *)
(**/**)
val to_int: t -> int
val from_int: int -> t Runtime'.Result.t
val from_int_exn: int -> t
val to_string: t -> string
val from_string_exn: string -> t
(**/**)
end
(**
`Struct` represents a structured data value, consisting of fields
which map to dynamically typed values. In some languages, `Struct`
might be supported by a native representation. For example, in
scripting languages like JS a struct is represented as an
object. The details of that representation are described together
with the proto support for the language.
The JSON representation for `Struct` is JSON object.
*)
and Struct : sig
type t = ((string * Value.t option) list)
(**
Unordered map of dynamically typed values.
*)
val make: ?fields:(string * Value.t option) list -> unit -> t
(** Helper function to generate a message using default values *)
val to_proto: t -> Runtime'.Writer.t
(** Serialize the message to binary format *)
val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from binary format *)
val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t
(** Serialize to Json (compatible with Yojson.Basic.t) *)
val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from Json (compatible with Yojson.Basic.t) *)
val name: unit -> string
(** Fully qualified protobuf name of this message *)
(**/**)
type make_t = ?fields:(string * Value.t option) list -> unit -> t
val merge: t -> t -> t
val to_proto': Runtime'.Writer.t -> t -> unit
val from_proto_exn: Runtime'.Reader.t -> t
val from_json_exn: Runtime'.Json.t -> t
(**/**)
end
(**
`Value` represents a dynamically typed value which can be either
null, a number, a string, a boolean, a recursive struct value, or a
list of values. A producer of value is expected to set one of these
variants. Absence of any variant indicates an error.
The JSON representation for `Value` is JSON value.
*)
and Value : sig
type t = ([ `not_set | `Null_value of NullValue.t | `Number_value of float | `String_value of string | `Bool_value of bool | `Struct_value of Struct.t | `List_value of ListValue.t ])
val make: ?kind:[ `not_set | `Null_value of NullValue.t | `Number_value of float | `String_value of string | `Bool_value of bool | `Struct_value of Struct.t | `List_value of ListValue.t ] -> unit -> t
(** Helper function to generate a message using default values *)
val to_proto: t -> Runtime'.Writer.t
(** Serialize the message to binary format *)
val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from binary format *)
val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t
(** Serialize to Json (compatible with Yojson.Basic.t) *)
val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from Json (compatible with Yojson.Basic.t) *)
val name: unit -> string
(** Fully qualified protobuf name of this message *)
(**/**)
type make_t = ?kind:[ `not_set | `Null_value of NullValue.t | `Number_value of float | `String_value of string | `Bool_value of bool | `Struct_value of Struct.t | `List_value of ListValue.t ] -> unit -> t
val merge: t -> t -> t
val to_proto': Runtime'.Writer.t -> t -> unit
val from_proto_exn: Runtime'.Reader.t -> t
val from_json_exn: Runtime'.Json.t -> t
(**/**)
end
(**
`ListValue` is a wrapper around a repeated field of values.
The JSON representation for `ListValue` is JSON array.
*)
and ListValue : sig
type t = (Value.t list)
(**
Repeated field of dynamically typed values.
*)
val make: ?values:Value.t list -> unit -> t
(** Helper function to generate a message using default values *)
val to_proto: t -> Runtime'.Writer.t
(** Serialize the message to binary format *)
val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from binary format *)
val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t
(** Serialize to Json (compatible with Yojson.Basic.t) *)
val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from Json (compatible with Yojson.Basic.t) *)
val name: unit -> string
(** Fully qualified protobuf name of this message *)
(**/**)
type make_t = ?values:Value.t list -> unit -> t
val merge: t -> t -> t
val to_proto': Runtime'.Writer.t -> t -> unit
val from_proto_exn: Runtime'.Reader.t -> t
val from_json_exn: Runtime'.Json.t -> t
(**/**)
end
end
end = struct
module rec Protobuf : sig
(**
`NullValue` is a singleton enumeration to represent the null value for the
`Value` type union.
{v
The JSON representation for `NullValue` is JSON `null`.
v}
*)
module rec NullValue : sig
type t =
| NULL_VALUE
(** Null value. *)
val name: unit -> string
(** Fully qualified protobuf name of this enum *)
(**/**)
val to_int: t -> int
val from_int: int -> t Runtime'.Result.t
val from_int_exn: int -> t
val to_string: t -> string
val from_string_exn: string -> t
(**/**)
end
(**
`Struct` represents a structured data value, consisting of fields
which map to dynamically typed values. In some languages, `Struct`
might be supported by a native representation. For example, in
scripting languages like JS a struct is represented as an
object. The details of that representation are described together
with the proto support for the language.
The JSON representation for `Struct` is JSON object.
*)
and Struct : sig
type t = ((string * Value.t option) list)
(**
Unordered map of dynamically typed values.
*)
val make: ?fields:(string * Value.t option) list -> unit -> t
(** Helper function to generate a message using default values *)
val to_proto: t -> Runtime'.Writer.t
(** Serialize the message to binary format *)
val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from binary format *)
val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t
(** Serialize to Json (compatible with Yojson.Basic.t) *)
val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from Json (compatible with Yojson.Basic.t) *)
val name: unit -> string
(** Fully qualified protobuf name of this message *)
(**/**)
type make_t = ?fields:(string * Value.t option) list -> unit -> t
val merge: t -> t -> t
val to_proto': Runtime'.Writer.t -> t -> unit
val from_proto_exn: Runtime'.Reader.t -> t
val from_json_exn: Runtime'.Json.t -> t
(**/**)
end
(**
`Value` represents a dynamically typed value which can be either
null, a number, a string, a boolean, a recursive struct value, or a
list of values. A producer of value is expected to set one of these
variants. Absence of any variant indicates an error.
The JSON representation for `Value` is JSON value.
*)
and Value : sig
type t = ([ `not_set | `Null_value of NullValue.t | `Number_value of float | `String_value of string | `Bool_value of bool | `Struct_value of Struct.t | `List_value of ListValue.t ])
val make: ?kind:[ `not_set | `Null_value of NullValue.t | `Number_value of float | `String_value of string | `Bool_value of bool | `Struct_value of Struct.t | `List_value of ListValue.t ] -> unit -> t
(** Helper function to generate a message using default values *)
val to_proto: t -> Runtime'.Writer.t
(** Serialize the message to binary format *)
val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from binary format *)
val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t
(** Serialize to Json (compatible with Yojson.Basic.t) *)
val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from Json (compatible with Yojson.Basic.t) *)
val name: unit -> string
(** Fully qualified protobuf name of this message *)
(**/**)
type make_t = ?kind:[ `not_set | `Null_value of NullValue.t | `Number_value of float | `String_value of string | `Bool_value of bool | `Struct_value of Struct.t | `List_value of ListValue.t ] -> unit -> t
val merge: t -> t -> t
val to_proto': Runtime'.Writer.t -> t -> unit
val from_proto_exn: Runtime'.Reader.t -> t
val from_json_exn: Runtime'.Json.t -> t
(**/**)
end
(**
`ListValue` is a wrapper around a repeated field of values.
The JSON representation for `ListValue` is JSON array.
*)
and ListValue : sig
type t = (Value.t list)
(**
Repeated field of dynamically typed values.
*)
val make: ?values:Value.t list -> unit -> t
(** Helper function to generate a message using default values *)
val to_proto: t -> Runtime'.Writer.t
(** Serialize the message to binary format *)
val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from binary format *)
val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t
(** Serialize to Json (compatible with Yojson.Basic.t) *)
val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from Json (compatible with Yojson.Basic.t) *)
val name: unit -> string
(** Fully qualified protobuf name of this message *)
(**/**)
type make_t = ?values:Value.t list -> unit -> t
val merge: t -> t -> t
val to_proto': Runtime'.Writer.t -> t -> unit
val from_proto_exn: Runtime'.Reader.t -> t
val from_json_exn: Runtime'.Json.t -> t
(**/**)
end
end = struct
module rec NullValue : sig
type t =
| NULL_VALUE
(** Null value. *)
val name: unit -> string
(** Fully qualified protobuf name of this enum *)
(**/**)
val to_int: t -> int
val from_int: int -> t Runtime'.Result.t
val from_int_exn: int -> t
val to_string: t -> string
val from_string_exn: string -> t
(**/**)
end = struct
module This'_ = NullValue
type t =
| NULL_VALUE
(** Null value. *)
let name () = ".google.protobuf.NullValue"
let to_int = function
| NULL_VALUE -> 0
let from_int_exn = function
| 0 -> NULL_VALUE
| n -> Runtime'.Result.raise (`Unknown_enum_value n)
let from_int e = Runtime'.Result.catch (fun () -> from_int_exn e)
let to_string = function
| NULL_VALUE -> "NULL_VALUE"
let from_string_exn = function
| "NULL_VALUE" -> NULL_VALUE
| s -> Runtime'.Result.raise (`Unknown_enum_name s)
end
and Struct : sig
type t = ((string * Value.t option) list)
(**
Unordered map of dynamically typed values.
*)
val make: ?fields:(string * Value.t option) list -> unit -> t
(** Helper function to generate a message using default values *)
val to_proto: t -> Runtime'.Writer.t
(** Serialize the message to binary format *)
val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from binary format *)
val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t
(** Serialize to Json (compatible with Yojson.Basic.t) *)
val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from Json (compatible with Yojson.Basic.t) *)
val name: unit -> string
(** Fully qualified protobuf name of this message *)
(**/**)
type make_t = ?fields:(string * Value.t option) list -> unit -> t
val merge: t -> t -> t
val to_proto': Runtime'.Writer.t -> t -> unit
val from_proto_exn: Runtime'.Reader.t -> t
val from_json_exn: Runtime'.Json.t -> t
(**/**)
end = struct
module This'_ = Struct
let name () = ".google.protobuf.Struct"
type t = ((string * Value.t option) list)
(**
Unordered map of dynamically typed values.
*)
type make_t = ?fields:(string * Value.t option) list -> unit -> t
let make ?(fields = []) () = (fields)
let merge =
let merge_fields = Runtime'.Merge.merge Runtime'.Spec.( map ((1, "fields", "fields"), (string, basic_opt ((2, "value", "value"), (message (module Value))))) ) in
fun (t1_fields) (t2_fields) -> merge_fields t1_fields t2_fields
let spec () = Runtime'.Spec.( map ((1, "fields", "fields"), (string, basic_opt ((2, "value", "value"), (message (module Value))))) ^:: nil )
let to_proto' =
let serialize = Runtime'.apply_lazy (fun () -> Runtime'.Serialize.serialize (spec ())) in
fun writer (fields) -> serialize writer fields
let to_proto t = let writer = Runtime'.Writer.init () in to_proto' writer t; writer
let from_proto_exn =
let constructor fields = (fields) in
Runtime'.apply_lazy (fun () -> Runtime'.Deserialize.deserialize (spec ()) constructor)
let from_proto writer = Runtime'.Result.catch (fun () -> from_proto_exn writer)
let to_json options =
let serialize = Runtime'.Serialize_json.serialize ~message_name:(name ()) (spec ()) options in
fun (fields) -> serialize fields
let from_json_exn =
let constructor fields = (fields) in
Runtime'.apply_lazy (fun () -> Runtime'.Deserialize_json.deserialize ~message_name:(name ()) (spec ()) constructor)
let from_json json = Runtime'.Result.catch (fun () -> from_json_exn json)
end
and Value : sig
type t = ([ `not_set | `Null_value of NullValue.t | `Number_value of float | `String_value of string | `Bool_value of bool | `Struct_value of Struct.t | `List_value of ListValue.t ])
val make: ?kind:[ `not_set | `Null_value of NullValue.t | `Number_value of float | `String_value of string | `Bool_value of bool | `Struct_value of Struct.t | `List_value of ListValue.t ] -> unit -> t
(** Helper function to generate a message using default values *)
val to_proto: t -> Runtime'.Writer.t
(** Serialize the message to binary format *)
val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from binary format *)
val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t
(** Serialize to Json (compatible with Yojson.Basic.t) *)
val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from Json (compatible with Yojson.Basic.t) *)
val name: unit -> string
(** Fully qualified protobuf name of this message *)
(**/**)
type make_t = ?kind:[ `not_set | `Null_value of NullValue.t | `Number_value of float | `String_value of string | `Bool_value of bool | `Struct_value of Struct.t | `List_value of ListValue.t ] -> unit -> t
val merge: t -> t -> t
val to_proto': Runtime'.Writer.t -> t -> unit
val from_proto_exn: Runtime'.Reader.t -> t
val from_json_exn: Runtime'.Json.t -> t
(**/**)
end = struct
module This'_ = Value
let name () = ".google.protobuf.Value"
type t = ([ `not_set | `Null_value of NullValue.t | `Number_value of float | `String_value of string | `Bool_value of bool | `Struct_value of Struct.t | `List_value of ListValue.t ])
type make_t = ?kind:[ `not_set | `Null_value of NullValue.t | `Number_value of float | `String_value of string | `Bool_value of bool | `Struct_value of Struct.t | `List_value of ListValue.t ] -> unit -> t
let make ?(kind = `not_set) () = (kind)
let merge =
let merge_oneof_kind__Null_value = Runtime'.Merge.merge Runtime'.Spec.( basic_req ((0, "", ""), (enum (module NullValue))) ) in
let merge_oneof_kind__Number_value = Runtime'.Merge.merge Runtime'.Spec.( basic_req ((0, "", ""), double) ) in
let merge_oneof_kind__String_value = Runtime'.Merge.merge Runtime'.Spec.( basic_req ((0, "", ""), string) ) in
let merge_oneof_kind__Bool_value = Runtime'.Merge.merge Runtime'.Spec.( basic_req ((0, "", ""), bool) ) in
let merge_oneof_kind__Struct_value = Runtime'.Merge.merge Runtime'.Spec.( basic_req ((0, "", ""), (message (module Struct))) ) in
let merge_oneof_kind__List_value = Runtime'.Merge.merge Runtime'.Spec.( basic_req ((0, "", ""), (message (module ListValue))) ) in
fun (t1_kind) (t2_kind) -> match (t1_kind, t2_kind) with
| (`Null_value v1, `Null_value v2) -> `Null_value (merge_oneof_kind__Null_value v1 v2)
| (`Number_value v1, `Number_value v2) -> `Number_value (merge_oneof_kind__Number_value v1 v2)
| (`String_value v1, `String_value v2) -> `String_value (merge_oneof_kind__String_value v1 v2)
| (`Bool_value v1, `Bool_value v2) -> `Bool_value (merge_oneof_kind__Bool_value v1 v2)
| (`Struct_value v1, `Struct_value v2) -> `Struct_value (merge_oneof_kind__Struct_value v1 v2)
| (`List_value v1, `List_value v2) -> `List_value (merge_oneof_kind__List_value v1 v2)
| (v1, `not_set) -> v1
| (_, v2) -> v2
let spec () = Runtime'.Spec.( oneof (([ oneof_elem ((1, "null_value", "nullValue"), (enum (module NullValue)), ((fun v -> `Null_value v), (function `Null_value v -> v | _ -> raise (Invalid_argument "Cannot destruct given oneof")))); oneof_elem ((2, "number_value", "numberValue"), double, ((fun v -> `Number_value v), (function `Number_value v -> v | _ -> raise (Invalid_argument "Cannot destruct given oneof")))); oneof_elem ((3, "string_value", "stringValue"), string, ((fun v -> `String_value v), (function `String_value v -> v | _ -> raise (Invalid_argument "Cannot destruct given oneof")))); oneof_elem ((4, "bool_value", "boolValue"), bool, ((fun v -> `Bool_value v), (function `Bool_value v -> v | _ -> raise (Invalid_argument "Cannot destruct given oneof")))); oneof_elem ((5, "struct_value", "structValue"), (message (module Struct)), ((fun v -> `Struct_value v), (function `Struct_value v -> v | _ -> raise (Invalid_argument "Cannot destruct given oneof")))); oneof_elem ((6, "list_value", "listValue"), (message (module ListValue)), ((fun v -> `List_value v), (function `List_value v -> v | _ -> raise (Invalid_argument "Cannot destruct given oneof")))) ], (function | `not_set -> failwith "Impossible case" | `Null_value _ -> 0 | `Number_value _ -> 1 | `String_value _ -> 2 | `Bool_value _ -> 3 | `Struct_value _ -> 4 | `List_value _ -> 5))) ^:: nil )
let to_proto' =
let serialize = Runtime'.apply_lazy (fun () -> Runtime'.Serialize.serialize (spec ())) in
fun writer (kind) -> serialize writer kind
let to_proto t = let writer = Runtime'.Writer.init () in to_proto' writer t; writer
let from_proto_exn =
let constructor kind = (kind) in
Runtime'.apply_lazy (fun () -> Runtime'.Deserialize.deserialize (spec ()) constructor)
let from_proto writer = Runtime'.Result.catch (fun () -> from_proto_exn writer)
let to_json options =
let serialize = Runtime'.Serialize_json.serialize ~message_name:(name ()) (spec ()) options in
fun (kind) -> serialize kind
let from_json_exn =
let constructor kind = (kind) in
Runtime'.apply_lazy (fun () -> Runtime'.Deserialize_json.deserialize ~message_name:(name ()) (spec ()) constructor)
let from_json json = Runtime'.Result.catch (fun () -> from_json_exn json)
end
and ListValue : sig
type t = (Value.t list)
(**
Repeated field of dynamically typed values.
*)
val make: ?values:Value.t list -> unit -> t
(** Helper function to generate a message using default values *)
val to_proto: t -> Runtime'.Writer.t
(** Serialize the message to binary format *)
val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from binary format *)
val to_json: Runtime'.Json_options.t -> t -> Runtime'.Json.t
(** Serialize to Json (compatible with Yojson.Basic.t) *)
val from_json: Runtime'.Json.t -> (t, [> Runtime'.Result.error]) result
(** Deserialize from Json (compatible with Yojson.Basic.t) *)
val name: unit -> string
(** Fully qualified protobuf name of this message *)
(**/**)
type make_t = ?values:Value.t list -> unit -> t
val merge: t -> t -> t
val to_proto': Runtime'.Writer.t -> t -> unit
val from_proto_exn: Runtime'.Reader.t -> t
val from_json_exn: Runtime'.Json.t -> t
(**/**)
end = struct
module This'_ = ListValue
let name () = ".google.protobuf.ListValue"
type t = (Value.t list)
(**
Repeated field of dynamically typed values.
*)
type make_t = ?values:Value.t list -> unit -> t
let make ?(values = []) () = (values)
let merge =
let merge_values = Runtime'.Merge.merge Runtime'.Spec.( repeated ((1, "values", "values"), (message (module Value)), not_packed) ) in
fun (t1_values) (t2_values) -> merge_values t1_values t2_values
let spec () = Runtime'.Spec.( repeated ((1, "values", "values"), (message (module Value)), not_packed) ^:: nil )
let to_proto' =
let serialize = Runtime'.apply_lazy (fun () -> Runtime'.Serialize.serialize (spec ())) in
fun writer (values) -> serialize writer values
let to_proto t = let writer = Runtime'.Writer.init () in to_proto' writer t; writer
let from_proto_exn =
let constructor values = (values) in
Runtime'.apply_lazy (fun () -> Runtime'.Deserialize.deserialize (spec ()) constructor)
let from_proto writer = Runtime'.Result.catch (fun () -> from_proto_exn writer)
let to_json options =
let serialize = Runtime'.Serialize_json.serialize ~message_name:(name ()) (spec ()) options in
fun (values) -> serialize values
let from_json_exn =
let constructor values = (values) in
Runtime'.apply_lazy (fun () -> Runtime'.Deserialize_json.deserialize ~message_name:(name ()) (spec ()) constructor)
let from_json json = Runtime'.Result.catch (fun () -> from_json_exn json)
end
end
end