package ocaml-protoc-plugin

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

Source file api.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
(********************************************************)
(*           AUTOGENERATED FILE - DO NOT EDIT!          *)
(********************************************************)
(* Generated by: ocaml-protoc-plugin                    *)
(* https://github.com/andersfugmann/ocaml-protoc-plugin *)
(********************************************************)
(*
  Source: google/protobuf/api.proto
  Syntax: proto3
  Parameters:
    debug=false
    annot=''
    opens=[]
    int64_as_int=true
    int32_as_int=true
    fixed_as_int=false
    singleton_record=false
    prefix_output_with_package=false
*)
[@@@ocaml.alert "-protobuf"] (* Disable deprecation warnings for protobuf*)

(**/**)
module Runtime' = Ocaml_protoc_plugin [@@warning "-33"]
module Imported'modules = struct
  module Source_context = Source_context
  module Type = Type
end
(**/**)
module rec Google : sig
  module rec Protobuf : sig

    (**
      Api is a light-weight descriptor for an API Interface.

      Interfaces are also described as "protocol buffer services" in some contexts,
      such as by the "service" keyword in a .proto file, but they are different
      from API Services, which represent a concrete implementation of an interface
      as opposed to simply a description of methods and bindings. They are also
      sometimes simply referred to as "APIs" in other contexts, such as the name of
      this message itself. See https://cloud.google.com/apis/design/glossary for
      detailed terminology.
    *)
    module rec Api : sig
      type t = {
      name: string;(** The fully qualified name of this interface, including package name
      followed by the interface's simple name. *)
      methods: Method.t list;(** The methods of this interface, in unspecified order. *)
      options: Imported'modules.Type.Google.Protobuf.Option.t list;(** Any metadata attached to the interface. *)
      version: string;(** A version string for this interface. If specified, must have the form
      `major-version.minor-version`, as in `1.10`. If the minor version is
      omitted, it defaults to zero. If the entire version field is empty, the
      major version is derived from the package name, as outlined below. If the
      field is not empty, the version in the package name will be verified to be
      consistent with what is provided here.

      The versioning schema uses \[semantic
      versioning\](http://semver.org) where the major version number
      indicates a breaking change and the minor version an additive,
      non-breaking change. Both version numbers are signals to users
      what to expect from different versions, and should be carefully
      chosen based on the product plan.

      The major version is also reflected in the package name of the
      interface, which must end in `v<major-version>`, as in
      `google.feature.v1`. For major versions 0 and 1, the suffix can
      be omitted. Zero major versions must only be used for
      experimental, non-GA interfaces. *)
      source_context: Imported'modules.Source_context.Google.Protobuf.SourceContext.t option;(** Source context for the protocol buffer service represented by this
      message. *)
      mixins: Mixin.t list;(** Included interfaces. See \[Mixin\]\[\]. *)
      syntax: Imported'modules.Type.Google.Protobuf.Syntax.t;(** The source syntax of the service. *)
      }
      val make: ?name:string -> ?methods:Method.t list -> ?options:Imported'modules.Type.Google.Protobuf.Option.t list -> ?version:string -> ?source_context:Imported'modules.Source_context.Google.Protobuf.SourceContext.t -> ?mixins:Mixin.t list -> ?syntax:Imported'modules.Type.Google.Protobuf.Syntax.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 = ?name:string -> ?methods:Method.t list -> ?options:Imported'modules.Type.Google.Protobuf.Option.t list -> ?version:string -> ?source_context:Imported'modules.Source_context.Google.Protobuf.SourceContext.t -> ?mixins:Mixin.t list -> ?syntax:Imported'modules.Type.Google.Protobuf.Syntax.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

    (** Method represents a method of an API interface. *)
    and Method : sig
      type t = {
      name: string;(** The simple name of this method. *)
      request_type_url: string;(** A URL of the input message type. *)
      request_streaming: bool;(** If true, the request is streamed. *)
      response_type_url: string;(** The URL of the output message type. *)
      response_streaming: bool;(** If true, the response is streamed. *)
      options: Imported'modules.Type.Google.Protobuf.Option.t list;(** Any metadata attached to the method. *)
      syntax: Imported'modules.Type.Google.Protobuf.Syntax.t;(** The source syntax of this method. *)
      }
      val make: ?name:string -> ?request_type_url:string -> ?request_streaming:bool -> ?response_type_url:string -> ?response_streaming:bool -> ?options:Imported'modules.Type.Google.Protobuf.Option.t list -> ?syntax:Imported'modules.Type.Google.Protobuf.Syntax.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 = ?name:string -> ?request_type_url:string -> ?request_streaming:bool -> ?response_type_url:string -> ?response_streaming:bool -> ?options:Imported'modules.Type.Google.Protobuf.Option.t list -> ?syntax:Imported'modules.Type.Google.Protobuf.Syntax.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

    (**
      Declares an API Interface to be included in this interface. The including
      interface must redeclare all the methods from the included interface, but
      documentation and options are inherited as follows:

      - If after comment and whitespace stripping, the documentation
      string of the redeclared method is empty, it will be inherited
      from the original method.
      - Each annotation belonging to the service config (http,
      visibility) which is not set in the redeclared method will be
      inherited.
      - If an http annotation is inherited, the path pattern will be
      modified as follows. Any version prefix will be replaced by the
      version of the including interface plus the \[root\]\[\] path if
      specified.
      Example of a simple mixin:
      {v
           package google.acl.v1;
           service AccessControl {
             // Get the underlying ACL object.
             rpc GetAcl(GetAclRequest) returns (Acl) {
               option (google.api.http).get = "/v1/{resource=**}:getAcl";
             }
           }

           package google.storage.v2;
           service Storage {
             rpc GetAcl(GetAclRequest) returns (Acl);

             // Get a data record.
             rpc GetData(GetDataRequest) returns (Data) {
               option (google.api.http).get = "/v2/{resource=**}";
             }
           }
      v}
      Example of a mixin configuration:
      {v
           apis:
      v}
      - name: google.storage.v2.Storage
      mixins:
      - name: google.acl.v1.AccessControl

      The mixin construct implies that all methods in `AccessControl` are
      also declared with same name and request/response types in
      `Storage`. A documentation generator or annotation processor will
      see the effective `Storage.GetAcl` method after inheriting
      documentation and annotations as follows:
      {v
           service Storage {
             // Get the underlying ACL object.
             rpc GetAcl(GetAclRequest) returns (Acl) {
               option (google.api.http).get = "/v2/{resource=**}:getAcl";
             }
             ...
           }
      v}
      Note how the version in the path pattern changed from `v1` to `v2`.

      If the `root` field in the mixin is specified, it should be a
      relative path under which inherited HTTP paths are placed. Example:
      {v
           apis:
      v}
      - name: google.storage.v2.Storage
      mixins:
      - name: google.acl.v1.AccessControl
      root: acls
      This implies the following inherited HTTP annotation:
      {v
           service Storage {
             // Get the underlying ACL object.
             rpc GetAcl(GetAclRequest) returns (Acl) {
               option (google.api.http).get = "/v2/acls/{resource=**}:getAcl";
             }
             ...
           }
      v}
    *)
    and Mixin : sig
      type t = {
      name: string;(** The fully qualified name of the interface which is included. *)
      root: string;(** If non-empty specifies a path under which inherited HTTP paths
      are rooted. *)
      }
      val make: ?name:string -> ?root:string -> 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 = ?name:string -> ?root:string -> 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

    (**
      Api is a light-weight descriptor for an API Interface.

      Interfaces are also described as "protocol buffer services" in some contexts,
      such as by the "service" keyword in a .proto file, but they are different
      from API Services, which represent a concrete implementation of an interface
      as opposed to simply a description of methods and bindings. They are also
      sometimes simply referred to as "APIs" in other contexts, such as the name of
      this message itself. See https://cloud.google.com/apis/design/glossary for
      detailed terminology.
    *)
    module rec Api : sig
      type t = {
      name: string;(** The fully qualified name of this interface, including package name
      followed by the interface's simple name. *)
      methods: Method.t list;(** The methods of this interface, in unspecified order. *)
      options: Imported'modules.Type.Google.Protobuf.Option.t list;(** Any metadata attached to the interface. *)
      version: string;(** A version string for this interface. If specified, must have the form
      `major-version.minor-version`, as in `1.10`. If the minor version is
      omitted, it defaults to zero. If the entire version field is empty, the
      major version is derived from the package name, as outlined below. If the
      field is not empty, the version in the package name will be verified to be
      consistent with what is provided here.

      The versioning schema uses \[semantic
      versioning\](http://semver.org) where the major version number
      indicates a breaking change and the minor version an additive,
      non-breaking change. Both version numbers are signals to users
      what to expect from different versions, and should be carefully
      chosen based on the product plan.

      The major version is also reflected in the package name of the
      interface, which must end in `v<major-version>`, as in
      `google.feature.v1`. For major versions 0 and 1, the suffix can
      be omitted. Zero major versions must only be used for
      experimental, non-GA interfaces. *)
      source_context: Imported'modules.Source_context.Google.Protobuf.SourceContext.t option;(** Source context for the protocol buffer service represented by this
      message. *)
      mixins: Mixin.t list;(** Included interfaces. See \[Mixin\]\[\]. *)
      syntax: Imported'modules.Type.Google.Protobuf.Syntax.t;(** The source syntax of the service. *)
      }
      val make: ?name:string -> ?methods:Method.t list -> ?options:Imported'modules.Type.Google.Protobuf.Option.t list -> ?version:string -> ?source_context:Imported'modules.Source_context.Google.Protobuf.SourceContext.t -> ?mixins:Mixin.t list -> ?syntax:Imported'modules.Type.Google.Protobuf.Syntax.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 = ?name:string -> ?methods:Method.t list -> ?options:Imported'modules.Type.Google.Protobuf.Option.t list -> ?version:string -> ?source_context:Imported'modules.Source_context.Google.Protobuf.SourceContext.t -> ?mixins:Mixin.t list -> ?syntax:Imported'modules.Type.Google.Protobuf.Syntax.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

    (** Method represents a method of an API interface. *)
    and Method : sig
      type t = {
      name: string;(** The simple name of this method. *)
      request_type_url: string;(** A URL of the input message type. *)
      request_streaming: bool;(** If true, the request is streamed. *)
      response_type_url: string;(** The URL of the output message type. *)
      response_streaming: bool;(** If true, the response is streamed. *)
      options: Imported'modules.Type.Google.Protobuf.Option.t list;(** Any metadata attached to the method. *)
      syntax: Imported'modules.Type.Google.Protobuf.Syntax.t;(** The source syntax of this method. *)
      }
      val make: ?name:string -> ?request_type_url:string -> ?request_streaming:bool -> ?response_type_url:string -> ?response_streaming:bool -> ?options:Imported'modules.Type.Google.Protobuf.Option.t list -> ?syntax:Imported'modules.Type.Google.Protobuf.Syntax.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 = ?name:string -> ?request_type_url:string -> ?request_streaming:bool -> ?response_type_url:string -> ?response_streaming:bool -> ?options:Imported'modules.Type.Google.Protobuf.Option.t list -> ?syntax:Imported'modules.Type.Google.Protobuf.Syntax.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

    (**
      Declares an API Interface to be included in this interface. The including
      interface must redeclare all the methods from the included interface, but
      documentation and options are inherited as follows:

      - If after comment and whitespace stripping, the documentation
      string of the redeclared method is empty, it will be inherited
      from the original method.
      - Each annotation belonging to the service config (http,
      visibility) which is not set in the redeclared method will be
      inherited.
      - If an http annotation is inherited, the path pattern will be
      modified as follows. Any version prefix will be replaced by the
      version of the including interface plus the \[root\]\[\] path if
      specified.
      Example of a simple mixin:
      {v
           package google.acl.v1;
           service AccessControl {
             // Get the underlying ACL object.
             rpc GetAcl(GetAclRequest) returns (Acl) {
               option (google.api.http).get = "/v1/{resource=**}:getAcl";
             }
           }

           package google.storage.v2;
           service Storage {
             rpc GetAcl(GetAclRequest) returns (Acl);

             // Get a data record.
             rpc GetData(GetDataRequest) returns (Data) {
               option (google.api.http).get = "/v2/{resource=**}";
             }
           }
      v}
      Example of a mixin configuration:
      {v
           apis:
      v}
      - name: google.storage.v2.Storage
      mixins:
      - name: google.acl.v1.AccessControl

      The mixin construct implies that all methods in `AccessControl` are
      also declared with same name and request/response types in
      `Storage`. A documentation generator or annotation processor will
      see the effective `Storage.GetAcl` method after inheriting
      documentation and annotations as follows:
      {v
           service Storage {
             // Get the underlying ACL object.
             rpc GetAcl(GetAclRequest) returns (Acl) {
               option (google.api.http).get = "/v2/{resource=**}:getAcl";
             }
             ...
           }
      v}
      Note how the version in the path pattern changed from `v1` to `v2`.

      If the `root` field in the mixin is specified, it should be a
      relative path under which inherited HTTP paths are placed. Example:
      {v
           apis:
      v}
      - name: google.storage.v2.Storage
      mixins:
      - name: google.acl.v1.AccessControl
      root: acls
      This implies the following inherited HTTP annotation:
      {v
           service Storage {
             // Get the underlying ACL object.
             rpc GetAcl(GetAclRequest) returns (Acl) {
               option (google.api.http).get = "/v2/acls/{resource=**}:getAcl";
             }
             ...
           }
      v}
    *)
    and Mixin : sig
      type t = {
      name: string;(** The fully qualified name of the interface which is included. *)
      root: string;(** If non-empty specifies a path under which inherited HTTP paths
      are rooted. *)
      }
      val make: ?name:string -> ?root:string -> 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 = ?name:string -> ?root:string -> 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 Api : sig
      type t = {
      name: string;(** The fully qualified name of this interface, including package name
      followed by the interface's simple name. *)
      methods: Method.t list;(** The methods of this interface, in unspecified order. *)
      options: Imported'modules.Type.Google.Protobuf.Option.t list;(** Any metadata attached to the interface. *)
      version: string;(** A version string for this interface. If specified, must have the form
      `major-version.minor-version`, as in `1.10`. If the minor version is
      omitted, it defaults to zero. If the entire version field is empty, the
      major version is derived from the package name, as outlined below. If the
      field is not empty, the version in the package name will be verified to be
      consistent with what is provided here.

      The versioning schema uses \[semantic
      versioning\](http://semver.org) where the major version number
      indicates a breaking change and the minor version an additive,
      non-breaking change. Both version numbers are signals to users
      what to expect from different versions, and should be carefully
      chosen based on the product plan.

      The major version is also reflected in the package name of the
      interface, which must end in `v<major-version>`, as in
      `google.feature.v1`. For major versions 0 and 1, the suffix can
      be omitted. Zero major versions must only be used for
      experimental, non-GA interfaces. *)
      source_context: Imported'modules.Source_context.Google.Protobuf.SourceContext.t option;(** Source context for the protocol buffer service represented by this
      message. *)
      mixins: Mixin.t list;(** Included interfaces. See \[Mixin\]\[\]. *)
      syntax: Imported'modules.Type.Google.Protobuf.Syntax.t;(** The source syntax of the service. *)
      }
      val make: ?name:string -> ?methods:Method.t list -> ?options:Imported'modules.Type.Google.Protobuf.Option.t list -> ?version:string -> ?source_context:Imported'modules.Source_context.Google.Protobuf.SourceContext.t -> ?mixins:Mixin.t list -> ?syntax:Imported'modules.Type.Google.Protobuf.Syntax.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 = ?name:string -> ?methods:Method.t list -> ?options:Imported'modules.Type.Google.Protobuf.Option.t list -> ?version:string -> ?source_context:Imported'modules.Source_context.Google.Protobuf.SourceContext.t -> ?mixins:Mixin.t list -> ?syntax:Imported'modules.Type.Google.Protobuf.Syntax.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'_ = Api
      let name () = ".google.protobuf.Api"
      type t = {
      name: string;(** The fully qualified name of this interface, including package name
      followed by the interface's simple name. *)
      methods: Method.t list;(** The methods of this interface, in unspecified order. *)
      options: Imported'modules.Type.Google.Protobuf.Option.t list;(** Any metadata attached to the interface. *)
      version: string;(** A version string for this interface. If specified, must have the form
      `major-version.minor-version`, as in `1.10`. If the minor version is
      omitted, it defaults to zero. If the entire version field is empty, the
      major version is derived from the package name, as outlined below. If the
      field is not empty, the version in the package name will be verified to be
      consistent with what is provided here.

      The versioning schema uses \[semantic
      versioning\](http://semver.org) where the major version number
      indicates a breaking change and the minor version an additive,
      non-breaking change. Both version numbers are signals to users
      what to expect from different versions, and should be carefully
      chosen based on the product plan.

      The major version is also reflected in the package name of the
      interface, which must end in `v<major-version>`, as in
      `google.feature.v1`. For major versions 0 and 1, the suffix can
      be omitted. Zero major versions must only be used for
      experimental, non-GA interfaces. *)
      source_context: Imported'modules.Source_context.Google.Protobuf.SourceContext.t option;(** Source context for the protocol buffer service represented by this
      message. *)
      mixins: Mixin.t list;(** Included interfaces. See \[Mixin\]\[\]. *)
      syntax: Imported'modules.Type.Google.Protobuf.Syntax.t;(** The source syntax of the service. *)
      }
      type make_t = ?name:string -> ?methods:Method.t list -> ?options:Imported'modules.Type.Google.Protobuf.Option.t list -> ?version:string -> ?source_context:Imported'modules.Source_context.Google.Protobuf.SourceContext.t -> ?mixins:Mixin.t list -> ?syntax:Imported'modules.Type.Google.Protobuf.Syntax.t -> unit -> t
      let make ?(name = {||}) ?(methods = []) ?(options = []) ?(version = {||}) ?source_context ?(mixins = []) ?(syntax = Imported'modules.Type.Google.Protobuf.Syntax.from_int_exn 0) () = { name; methods; options; version; source_context; mixins; syntax }
      let merge =
      let merge_name = Runtime'.Merge.merge Runtime'.Spec.( basic ((1, "name", "name"), string, ({||})) ) in
      let merge_methods = Runtime'.Merge.merge Runtime'.Spec.( repeated ((2, "methods", "methods"), (message (module Method)), not_packed) ) in
      let merge_options = Runtime'.Merge.merge Runtime'.Spec.( repeated ((3, "options", "options"), (message (module Imported'modules.Type.Google.Protobuf.Option)), not_packed) ) in
      let merge_version = Runtime'.Merge.merge Runtime'.Spec.( basic ((4, "version", "version"), string, ({||})) ) in
      let merge_source_context = Runtime'.Merge.merge Runtime'.Spec.( basic_opt ((5, "source_context", "sourceContext"), (message (module Imported'modules.Source_context.Google.Protobuf.SourceContext))) ) in
      let merge_mixins = Runtime'.Merge.merge Runtime'.Spec.( repeated ((6, "mixins", "mixins"), (message (module Mixin)), not_packed) ) in
      let merge_syntax = Runtime'.Merge.merge Runtime'.Spec.( basic ((7, "syntax", "syntax"), (enum (module Imported'modules.Type.Google.Protobuf.Syntax)), (Imported'modules.Type.Google.Protobuf.Syntax.from_int_exn 0)) ) in
      fun t1 t2 -> {
      name = (merge_name t1.name t2.name);
      methods = (merge_methods t1.methods t2.methods);
      options = (merge_options t1.options t2.options);
      version = (merge_version t1.version t2.version);
      source_context = (merge_source_context t1.source_context t2.source_context);
      mixins = (merge_mixins t1.mixins t2.mixins);
      syntax = (merge_syntax t1.syntax t2.syntax);
       }
      let spec () = Runtime'.Spec.( basic ((1, "name", "name"), string, ({||})) ^:: repeated ((2, "methods", "methods"), (message (module Method)), not_packed) ^:: repeated ((3, "options", "options"), (message (module Imported'modules.Type.Google.Protobuf.Option)), not_packed) ^:: basic ((4, "version", "version"), string, ({||})) ^:: basic_opt ((5, "source_context", "sourceContext"), (message (module Imported'modules.Source_context.Google.Protobuf.SourceContext))) ^:: repeated ((6, "mixins", "mixins"), (message (module Mixin)), not_packed) ^:: basic ((7, "syntax", "syntax"), (enum (module Imported'modules.Type.Google.Protobuf.Syntax)), (Imported'modules.Type.Google.Protobuf.Syntax.from_int_exn 0)) ^:: nil )
      let to_proto' =
        let serialize = Runtime'.apply_lazy (fun () -> Runtime'.Serialize.serialize (spec ())) in
        fun writer { name; methods; options; version; source_context; mixins; syntax } -> serialize writer name methods options version source_context mixins syntax

      let to_proto t = let writer = Runtime'.Writer.init () in to_proto' writer t; writer
      let from_proto_exn =
        let constructor name methods options version source_context mixins syntax = { name; methods; options; version; source_context; mixins; syntax } 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 { name; methods; options; version; source_context; mixins; syntax } -> serialize name methods options version source_context mixins syntax
      let from_json_exn =
        let constructor name methods options version source_context mixins syntax = { name; methods; options; version; source_context; mixins; syntax } 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 Method : sig
      type t = {
      name: string;(** The simple name of this method. *)
      request_type_url: string;(** A URL of the input message type. *)
      request_streaming: bool;(** If true, the request is streamed. *)
      response_type_url: string;(** The URL of the output message type. *)
      response_streaming: bool;(** If true, the response is streamed. *)
      options: Imported'modules.Type.Google.Protobuf.Option.t list;(** Any metadata attached to the method. *)
      syntax: Imported'modules.Type.Google.Protobuf.Syntax.t;(** The source syntax of this method. *)
      }
      val make: ?name:string -> ?request_type_url:string -> ?request_streaming:bool -> ?response_type_url:string -> ?response_streaming:bool -> ?options:Imported'modules.Type.Google.Protobuf.Option.t list -> ?syntax:Imported'modules.Type.Google.Protobuf.Syntax.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 = ?name:string -> ?request_type_url:string -> ?request_streaming:bool -> ?response_type_url:string -> ?response_streaming:bool -> ?options:Imported'modules.Type.Google.Protobuf.Option.t list -> ?syntax:Imported'modules.Type.Google.Protobuf.Syntax.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'_ = Method
      let name () = ".google.protobuf.Method"
      type t = {
      name: string;(** The simple name of this method. *)
      request_type_url: string;(** A URL of the input message type. *)
      request_streaming: bool;(** If true, the request is streamed. *)
      response_type_url: string;(** The URL of the output message type. *)
      response_streaming: bool;(** If true, the response is streamed. *)
      options: Imported'modules.Type.Google.Protobuf.Option.t list;(** Any metadata attached to the method. *)
      syntax: Imported'modules.Type.Google.Protobuf.Syntax.t;(** The source syntax of this method. *)
      }
      type make_t = ?name:string -> ?request_type_url:string -> ?request_streaming:bool -> ?response_type_url:string -> ?response_streaming:bool -> ?options:Imported'modules.Type.Google.Protobuf.Option.t list -> ?syntax:Imported'modules.Type.Google.Protobuf.Syntax.t -> unit -> t
      let make ?(name = {||}) ?(request_type_url = {||}) ?(request_streaming = false) ?(response_type_url = {||}) ?(response_streaming = false) ?(options = []) ?(syntax = Imported'modules.Type.Google.Protobuf.Syntax.from_int_exn 0) () = { name; request_type_url; request_streaming; response_type_url; response_streaming; options; syntax }
      let merge =
      let merge_name = Runtime'.Merge.merge Runtime'.Spec.( basic ((1, "name", "name"), string, ({||})) ) in
      let merge_request_type_url = Runtime'.Merge.merge Runtime'.Spec.( basic ((2, "request_type_url", "requestTypeUrl"), string, ({||})) ) in
      let merge_request_streaming = Runtime'.Merge.merge Runtime'.Spec.( basic ((3, "request_streaming", "requestStreaming"), bool, (false)) ) in
      let merge_response_type_url = Runtime'.Merge.merge Runtime'.Spec.( basic ((4, "response_type_url", "responseTypeUrl"), string, ({||})) ) in
      let merge_response_streaming = Runtime'.Merge.merge Runtime'.Spec.( basic ((5, "response_streaming", "responseStreaming"), bool, (false)) ) in
      let merge_options = Runtime'.Merge.merge Runtime'.Spec.( repeated ((6, "options", "options"), (message (module Imported'modules.Type.Google.Protobuf.Option)), not_packed) ) in
      let merge_syntax = Runtime'.Merge.merge Runtime'.Spec.( basic ((7, "syntax", "syntax"), (enum (module Imported'modules.Type.Google.Protobuf.Syntax)), (Imported'modules.Type.Google.Protobuf.Syntax.from_int_exn 0)) ) in
      fun t1 t2 -> {
      name = (merge_name t1.name t2.name);
      request_type_url = (merge_request_type_url t1.request_type_url t2.request_type_url);
      request_streaming = (merge_request_streaming t1.request_streaming t2.request_streaming);
      response_type_url = (merge_response_type_url t1.response_type_url t2.response_type_url);
      response_streaming = (merge_response_streaming t1.response_streaming t2.response_streaming);
      options = (merge_options t1.options t2.options);
      syntax = (merge_syntax t1.syntax t2.syntax);
       }
      let spec () = Runtime'.Spec.( basic ((1, "name", "name"), string, ({||})) ^:: basic ((2, "request_type_url", "requestTypeUrl"), string, ({||})) ^:: basic ((3, "request_streaming", "requestStreaming"), bool, (false)) ^:: basic ((4, "response_type_url", "responseTypeUrl"), string, ({||})) ^:: basic ((5, "response_streaming", "responseStreaming"), bool, (false)) ^:: repeated ((6, "options", "options"), (message (module Imported'modules.Type.Google.Protobuf.Option)), not_packed) ^:: basic ((7, "syntax", "syntax"), (enum (module Imported'modules.Type.Google.Protobuf.Syntax)), (Imported'modules.Type.Google.Protobuf.Syntax.from_int_exn 0)) ^:: nil )
      let to_proto' =
        let serialize = Runtime'.apply_lazy (fun () -> Runtime'.Serialize.serialize (spec ())) in
        fun writer { name; request_type_url; request_streaming; response_type_url; response_streaming; options; syntax } -> serialize writer name request_type_url request_streaming response_type_url response_streaming options syntax

      let to_proto t = let writer = Runtime'.Writer.init () in to_proto' writer t; writer
      let from_proto_exn =
        let constructor name request_type_url request_streaming response_type_url response_streaming options syntax = { name; request_type_url; request_streaming; response_type_url; response_streaming; options; syntax } 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 { name; request_type_url; request_streaming; response_type_url; response_streaming; options; syntax } -> serialize name request_type_url request_streaming response_type_url response_streaming options syntax
      let from_json_exn =
        let constructor name request_type_url request_streaming response_type_url response_streaming options syntax = { name; request_type_url; request_streaming; response_type_url; response_streaming; options; syntax } 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 Mixin : sig
      type t = {
      name: string;(** The fully qualified name of the interface which is included. *)
      root: string;(** If non-empty specifies a path under which inherited HTTP paths
      are rooted. *)
      }
      val make: ?name:string -> ?root:string -> 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 = ?name:string -> ?root:string -> 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'_ = Mixin
      let name () = ".google.protobuf.Mixin"
      type t = {
      name: string;(** The fully qualified name of the interface which is included. *)
      root: string;(** If non-empty specifies a path under which inherited HTTP paths
      are rooted. *)
      }
      type make_t = ?name:string -> ?root:string -> unit -> t
      let make ?(name = {||}) ?(root = {||}) () = { name; root }
      let merge =
      let merge_name = Runtime'.Merge.merge Runtime'.Spec.( basic ((1, "name", "name"), string, ({||})) ) in
      let merge_root = Runtime'.Merge.merge Runtime'.Spec.( basic ((2, "root", "root"), string, ({||})) ) in
      fun t1 t2 -> {
      name = (merge_name t1.name t2.name);
      root = (merge_root t1.root t2.root);
       }
      let spec () = Runtime'.Spec.( basic ((1, "name", "name"), string, ({||})) ^:: basic ((2, "root", "root"), string, ({||})) ^:: nil )
      let to_proto' =
        let serialize = Runtime'.apply_lazy (fun () -> Runtime'.Serialize.serialize (spec ())) in
        fun writer { name; root } -> serialize writer name root

      let to_proto t = let writer = Runtime'.Writer.init () in to_proto' writer t; writer
      let from_proto_exn =
        let constructor name root = { name; root } 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 { name; root } -> serialize name root
      let from_json_exn =
        let constructor name root = { name; root } 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
OCaml

Innovation. Community. Security.