protobuf-protoc-bin 33.3__py2.py3-none-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. protobuf_protoc_bin/__init__.py +9 -0
  2. protobuf_protoc_bin/_version.py +34 -0
  3. protobuf_protoc_bin-33.3.data/data/include/google/protobuf/any.proto +162 -0
  4. protobuf_protoc_bin-33.3.data/data/include/google/protobuf/api.proto +229 -0
  5. protobuf_protoc_bin-33.3.data/data/include/google/protobuf/compiler/plugin.proto +180 -0
  6. protobuf_protoc_bin-33.3.data/data/include/google/protobuf/cpp_features.proto +67 -0
  7. protobuf_protoc_bin-33.3.data/data/include/google/protobuf/descriptor.proto +1434 -0
  8. protobuf_protoc_bin-33.3.data/data/include/google/protobuf/duration.proto +115 -0
  9. protobuf_protoc_bin-33.3.data/data/include/google/protobuf/empty.proto +51 -0
  10. protobuf_protoc_bin-33.3.data/data/include/google/protobuf/field_mask.proto +245 -0
  11. protobuf_protoc_bin-33.3.data/data/include/google/protobuf/go_features.proto +83 -0
  12. protobuf_protoc_bin-33.3.data/data/include/google/protobuf/java_features.proto +132 -0
  13. protobuf_protoc_bin-33.3.data/data/include/google/protobuf/source_context.proto +48 -0
  14. protobuf_protoc_bin-33.3.data/data/include/google/protobuf/struct.proto +95 -0
  15. protobuf_protoc_bin-33.3.data/data/include/google/protobuf/timestamp.proto +145 -0
  16. protobuf_protoc_bin-33.3.data/data/include/google/protobuf/type.proto +217 -0
  17. protobuf_protoc_bin-33.3.data/data/include/google/protobuf/wrappers.proto +157 -0
  18. protobuf_protoc_bin-33.3.data/scripts/protoc.exe +0 -0
  19. protobuf_protoc_bin-33.3.dist-info/METADATA +92 -0
  20. protobuf_protoc_bin-33.3.dist-info/RECORD +22 -0
  21. protobuf_protoc_bin-33.3.dist-info/WHEEL +6 -0
  22. protobuf_protoc_bin-33.3.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1434 @@
1
+ // Protocol Buffers - Google's data interchange format
2
+ // Copyright 2008 Google Inc. All rights reserved.
3
+ // https://developers.google.com/protocol-buffers/
4
+ //
5
+ // Redistribution and use in source and binary forms, with or without
6
+ // modification, are permitted provided that the following conditions are
7
+ // met:
8
+ //
9
+ // * Redistributions of source code must retain the above copyright
10
+ // notice, this list of conditions and the following disclaimer.
11
+ // * Redistributions in binary form must reproduce the above
12
+ // copyright notice, this list of conditions and the following disclaimer
13
+ // in the documentation and/or other materials provided with the
14
+ // distribution.
15
+ // * Neither the name of Google Inc. nor the names of its
16
+ // contributors may be used to endorse or promote products derived from
17
+ // this software without specific prior written permission.
18
+ //
19
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+
31
+ // Author: kenton@google.com (Kenton Varda)
32
+ // Based on original Protocol Buffers design by
33
+ // Sanjay Ghemawat, Jeff Dean, and others.
34
+ //
35
+ // The messages in this file describe the definitions found in .proto files.
36
+ // A valid .proto file can be translated directly to a FileDescriptorProto
37
+ // without any other information (e.g. without reading its imports).
38
+
39
+ syntax = "proto2";
40
+
41
+ package google.protobuf;
42
+
43
+ option go_package = "google.golang.org/protobuf/types/descriptorpb";
44
+ option java_package = "com.google.protobuf";
45
+ option java_outer_classname = "DescriptorProtos";
46
+ option csharp_namespace = "Google.Protobuf.Reflection";
47
+ option objc_class_prefix = "GPB";
48
+ option cc_enable_arenas = true;
49
+
50
+ // descriptor.proto must be optimized for speed because reflection-based
51
+ // algorithms don't work during bootstrapping.
52
+ option optimize_for = SPEED;
53
+
54
+ // The protocol compiler can output a FileDescriptorSet containing the .proto
55
+ // files it parses.
56
+ message FileDescriptorSet {
57
+ repeated FileDescriptorProto file = 1;
58
+
59
+ // Extensions for tooling.
60
+ extensions 536000000 [declaration = {
61
+ number: 536000000
62
+ type: ".buf.descriptor.v1.FileDescriptorSetExtension"
63
+ full_name: ".buf.descriptor.v1.buf_file_descriptor_set_extension"
64
+ }];
65
+ }
66
+
67
+ // The full set of known editions.
68
+ enum Edition {
69
+ // A placeholder for an unknown edition value.
70
+ EDITION_UNKNOWN = 0;
71
+
72
+ // A placeholder edition for specifying default behaviors *before* a feature
73
+ // was first introduced. This is effectively an "infinite past".
74
+ EDITION_LEGACY = 900;
75
+
76
+ // Legacy syntax "editions". These pre-date editions, but behave much like
77
+ // distinct editions. These can't be used to specify the edition of proto
78
+ // files, but feature definitions must supply proto2/proto3 defaults for
79
+ // backwards compatibility.
80
+ EDITION_PROTO2 = 998;
81
+ EDITION_PROTO3 = 999;
82
+
83
+ // Editions that have been released. The specific values are arbitrary and
84
+ // should not be depended on, but they will always be time-ordered for easy
85
+ // comparison.
86
+ EDITION_2023 = 1000;
87
+ EDITION_2024 = 1001;
88
+
89
+ // A placeholder edition for developing and testing unscheduled features.
90
+ EDITION_UNSTABLE = 9999;
91
+
92
+ // Placeholder editions for testing feature resolution. These should not be
93
+ // used or relied on outside of tests.
94
+ EDITION_1_TEST_ONLY = 1;
95
+ EDITION_2_TEST_ONLY = 2;
96
+ EDITION_99997_TEST_ONLY = 99997;
97
+ EDITION_99998_TEST_ONLY = 99998;
98
+ EDITION_99999_TEST_ONLY = 99999;
99
+
100
+ // Placeholder for specifying unbounded edition support. This should only
101
+ // ever be used by plugins that can expect to never require any changes to
102
+ // support a new edition.
103
+ EDITION_MAX = 0x7FFFFFFF;
104
+ }
105
+
106
+ // Describes a complete .proto file.
107
+ message FileDescriptorProto {
108
+ optional string name = 1; // file name, relative to root of source tree
109
+ optional string package = 2; // e.g. "foo", "foo.bar", etc.
110
+
111
+ // Names of files imported by this file.
112
+ repeated string dependency = 3;
113
+ // Indexes of the public imported files in the dependency list above.
114
+ repeated int32 public_dependency = 10;
115
+ // Indexes of the weak imported files in the dependency list.
116
+ // For Google-internal migration only. Do not use.
117
+ repeated int32 weak_dependency = 11;
118
+
119
+ // Names of files imported by this file purely for the purpose of providing
120
+ // option extensions. These are excluded from the dependency list above.
121
+ repeated string option_dependency = 15;
122
+
123
+ // All top-level definitions in this file.
124
+ repeated DescriptorProto message_type = 4;
125
+ repeated EnumDescriptorProto enum_type = 5;
126
+ repeated ServiceDescriptorProto service = 6;
127
+ repeated FieldDescriptorProto extension = 7;
128
+
129
+ optional FileOptions options = 8;
130
+
131
+ // This field contains optional information about the original source code.
132
+ // You may safely remove this entire field without harming runtime
133
+ // functionality of the descriptors -- the information is needed only by
134
+ // development tools.
135
+ optional SourceCodeInfo source_code_info = 9;
136
+
137
+ // The syntax of the proto file.
138
+ // The supported values are "proto2", "proto3", and "editions".
139
+ //
140
+ // If `edition` is present, this value must be "editions".
141
+ // WARNING: This field should only be used by protobuf plugins or special
142
+ // cases like the proto compiler. Other uses are discouraged and
143
+ // developers should rely on the protoreflect APIs for their client language.
144
+ optional string syntax = 12;
145
+
146
+ // The edition of the proto file.
147
+ // WARNING: This field should only be used by protobuf plugins or special
148
+ // cases like the proto compiler. Other uses are discouraged and
149
+ // developers should rely on the protoreflect APIs for their client language.
150
+ optional Edition edition = 14;
151
+ }
152
+
153
+ // Describes a message type.
154
+ message DescriptorProto {
155
+ optional string name = 1;
156
+
157
+ repeated FieldDescriptorProto field = 2;
158
+ repeated FieldDescriptorProto extension = 6;
159
+
160
+ repeated DescriptorProto nested_type = 3;
161
+ repeated EnumDescriptorProto enum_type = 4;
162
+
163
+ message ExtensionRange {
164
+ optional int32 start = 1; // Inclusive.
165
+ optional int32 end = 2; // Exclusive.
166
+
167
+ optional ExtensionRangeOptions options = 3;
168
+ }
169
+ repeated ExtensionRange extension_range = 5;
170
+
171
+ repeated OneofDescriptorProto oneof_decl = 8;
172
+
173
+ optional MessageOptions options = 7;
174
+
175
+ // Range of reserved tag numbers. Reserved tag numbers may not be used by
176
+ // fields or extension ranges in the same message. Reserved ranges may
177
+ // not overlap.
178
+ message ReservedRange {
179
+ optional int32 start = 1; // Inclusive.
180
+ optional int32 end = 2; // Exclusive.
181
+ }
182
+ repeated ReservedRange reserved_range = 9;
183
+ // Reserved field names, which may not be used by fields in the same message.
184
+ // A given name may only be reserved once.
185
+ repeated string reserved_name = 10;
186
+
187
+ // Support for `export` and `local` keywords on enums.
188
+ optional SymbolVisibility visibility = 11;
189
+ }
190
+
191
+ message ExtensionRangeOptions {
192
+ // The parser stores options it doesn't recognize here. See above.
193
+ repeated UninterpretedOption uninterpreted_option = 999;
194
+
195
+ message Declaration {
196
+ // The extension number declared within the extension range.
197
+ optional int32 number = 1;
198
+
199
+ // The fully-qualified name of the extension field. There must be a leading
200
+ // dot in front of the full name.
201
+ optional string full_name = 2;
202
+
203
+ // The fully-qualified type name of the extension field. Unlike
204
+ // Metadata.type, Declaration.type must have a leading dot for messages
205
+ // and enums.
206
+ optional string type = 3;
207
+
208
+ // If true, indicates that the number is reserved in the extension range,
209
+ // and any extension field with the number will fail to compile. Set this
210
+ // when a declared extension field is deleted.
211
+ optional bool reserved = 5;
212
+
213
+ // If true, indicates that the extension must be defined as repeated.
214
+ // Otherwise the extension must be defined as optional.
215
+ optional bool repeated = 6;
216
+
217
+ reserved 4; // removed is_repeated
218
+ }
219
+
220
+ // For external users: DO NOT USE. We are in the process of open sourcing
221
+ // extension declaration and executing internal cleanups before it can be
222
+ // used externally.
223
+ repeated Declaration declaration = 2 [retention = RETENTION_SOURCE];
224
+
225
+ // Any features defined in the specific edition.
226
+ optional FeatureSet features = 50;
227
+
228
+ // The verification state of the extension range.
229
+ enum VerificationState {
230
+ // All the extensions of the range must be declared.
231
+ DECLARATION = 0;
232
+ UNVERIFIED = 1;
233
+ }
234
+
235
+ // The verification state of the range.
236
+ // TODO: flip the default to DECLARATION once all empty ranges
237
+ // are marked as UNVERIFIED.
238
+ optional VerificationState verification = 3
239
+ [default = UNVERIFIED, retention = RETENTION_SOURCE];
240
+
241
+ // Clients can define custom options in extensions of this message. See above.
242
+ extensions 1000 to max;
243
+ }
244
+
245
+ // Describes a field within a message.
246
+ message FieldDescriptorProto {
247
+ enum Type {
248
+ // 0 is reserved for errors.
249
+ // Order is weird for historical reasons.
250
+ TYPE_DOUBLE = 1;
251
+ TYPE_FLOAT = 2;
252
+ // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
253
+ // negative values are likely.
254
+ TYPE_INT64 = 3;
255
+ TYPE_UINT64 = 4;
256
+ // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
257
+ // negative values are likely.
258
+ TYPE_INT32 = 5;
259
+ TYPE_FIXED64 = 6;
260
+ TYPE_FIXED32 = 7;
261
+ TYPE_BOOL = 8;
262
+ TYPE_STRING = 9;
263
+ // Tag-delimited aggregate.
264
+ // Group type is deprecated and not supported after google.protobuf. However, Proto3
265
+ // implementations should still be able to parse the group wire format and
266
+ // treat group fields as unknown fields. In Editions, the group wire format
267
+ // can be enabled via the `message_encoding` feature.
268
+ TYPE_GROUP = 10;
269
+ TYPE_MESSAGE = 11; // Length-delimited aggregate.
270
+
271
+ // New in version 2.
272
+ TYPE_BYTES = 12;
273
+ TYPE_UINT32 = 13;
274
+ TYPE_ENUM = 14;
275
+ TYPE_SFIXED32 = 15;
276
+ TYPE_SFIXED64 = 16;
277
+ TYPE_SINT32 = 17; // Uses ZigZag encoding.
278
+ TYPE_SINT64 = 18; // Uses ZigZag encoding.
279
+ }
280
+
281
+ enum Label {
282
+ // 0 is reserved for errors
283
+ LABEL_OPTIONAL = 1;
284
+ LABEL_REPEATED = 3;
285
+ // The required label is only allowed in google.protobuf. In proto3 and Editions
286
+ // it's explicitly prohibited. In Editions, the `field_presence` feature
287
+ // can be used to get this behavior.
288
+ LABEL_REQUIRED = 2;
289
+ }
290
+
291
+ optional string name = 1;
292
+ optional int32 number = 3;
293
+ optional Label label = 4;
294
+
295
+ // If type_name is set, this need not be set. If both this and type_name
296
+ // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
297
+ optional Type type = 5;
298
+
299
+ // For message and enum types, this is the name of the type. If the name
300
+ // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
301
+ // rules are used to find the type (i.e. first the nested types within this
302
+ // message are searched, then within the parent, on up to the root
303
+ // namespace).
304
+ optional string type_name = 6;
305
+
306
+ // For extensions, this is the name of the type being extended. It is
307
+ // resolved in the same manner as type_name.
308
+ optional string extendee = 2;
309
+
310
+ // For numeric types, contains the original text representation of the value.
311
+ // For booleans, "true" or "false".
312
+ // For strings, contains the default text contents (not escaped in any way).
313
+ // For bytes, contains the C escaped value. All bytes >= 128 are escaped.
314
+ optional string default_value = 7;
315
+
316
+ // If set, gives the index of a oneof in the containing type's oneof_decl
317
+ // list. This field is a member of that oneof.
318
+ optional int32 oneof_index = 9;
319
+
320
+ // JSON name of this field. The value is set by protocol compiler. If the
321
+ // user has set a "json_name" option on this field, that option's value
322
+ // will be used. Otherwise, it's deduced from the field's name by converting
323
+ // it to camelCase.
324
+ optional string json_name = 10;
325
+
326
+ optional FieldOptions options = 8;
327
+
328
+ // If true, this is a proto3 "optional". When a proto3 field is optional, it
329
+ // tracks presence regardless of field type.
330
+ //
331
+ // When proto3_optional is true, this field must belong to a oneof to signal
332
+ // to old proto3 clients that presence is tracked for this field. This oneof
333
+ // is known as a "synthetic" oneof, and this field must be its sole member
334
+ // (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs
335
+ // exist in the descriptor only, and do not generate any API. Synthetic oneofs
336
+ // must be ordered after all "real" oneofs.
337
+ //
338
+ // For message fields, proto3_optional doesn't create any semantic change,
339
+ // since non-repeated message fields always track presence. However it still
340
+ // indicates the semantic detail of whether the user wrote "optional" or not.
341
+ // This can be useful for round-tripping the .proto file. For consistency we
342
+ // give message fields a synthetic oneof also, even though it is not required
343
+ // to track presence. This is especially important because the parser can't
344
+ // tell if a field is a message or an enum, so it must always create a
345
+ // synthetic oneof.
346
+ //
347
+ // Proto2 optional fields do not set this flag, because they already indicate
348
+ // optional with `LABEL_OPTIONAL`.
349
+ optional bool proto3_optional = 17;
350
+ }
351
+
352
+ // Describes a oneof.
353
+ message OneofDescriptorProto {
354
+ optional string name = 1;
355
+ optional OneofOptions options = 2;
356
+ }
357
+
358
+ // Describes an enum type.
359
+ message EnumDescriptorProto {
360
+ optional string name = 1;
361
+
362
+ repeated EnumValueDescriptorProto value = 2;
363
+
364
+ optional EnumOptions options = 3;
365
+
366
+ // Range of reserved numeric values. Reserved values may not be used by
367
+ // entries in the same enum. Reserved ranges may not overlap.
368
+ //
369
+ // Note that this is distinct from DescriptorProto.ReservedRange in that it
370
+ // is inclusive such that it can appropriately represent the entire int32
371
+ // domain.
372
+ message EnumReservedRange {
373
+ optional int32 start = 1; // Inclusive.
374
+ optional int32 end = 2; // Inclusive.
375
+ }
376
+
377
+ // Range of reserved numeric values. Reserved numeric values may not be used
378
+ // by enum values in the same enum declaration. Reserved ranges may not
379
+ // overlap.
380
+ repeated EnumReservedRange reserved_range = 4;
381
+
382
+ // Reserved enum value names, which may not be reused. A given name may only
383
+ // be reserved once.
384
+ repeated string reserved_name = 5;
385
+
386
+ // Support for `export` and `local` keywords on enums.
387
+ optional SymbolVisibility visibility = 6;
388
+ }
389
+
390
+ // Describes a value within an enum.
391
+ message EnumValueDescriptorProto {
392
+ optional string name = 1;
393
+ optional int32 number = 2;
394
+
395
+ optional EnumValueOptions options = 3;
396
+ }
397
+
398
+ // Describes a service.
399
+ message ServiceDescriptorProto {
400
+ optional string name = 1;
401
+ repeated MethodDescriptorProto method = 2;
402
+
403
+ optional ServiceOptions options = 3;
404
+
405
+ reserved 4;
406
+ reserved "stream";
407
+ }
408
+
409
+ // Describes a method of a service.
410
+ message MethodDescriptorProto {
411
+ optional string name = 1;
412
+
413
+ // Input and output type names. These are resolved in the same way as
414
+ // FieldDescriptorProto.type_name, but must refer to a message type.
415
+ optional string input_type = 2;
416
+ optional string output_type = 3;
417
+
418
+ optional MethodOptions options = 4;
419
+
420
+ // Identifies if client streams multiple client messages
421
+ optional bool client_streaming = 5 [default = false];
422
+ // Identifies if server streams multiple server messages
423
+ optional bool server_streaming = 6 [default = false];
424
+ }
425
+
426
+ // ===================================================================
427
+ // Options
428
+
429
+ // Each of the definitions above may have "options" attached. These are
430
+ // just annotations which may cause code to be generated slightly differently
431
+ // or may contain hints for code that manipulates protocol messages.
432
+ //
433
+ // Clients may define custom options as extensions of the *Options messages.
434
+ // These extensions may not yet be known at parsing time, so the parser cannot
435
+ // store the values in them. Instead it stores them in a field in the *Options
436
+ // message called uninterpreted_option. This field must have the same name
437
+ // across all *Options messages. We then use this field to populate the
438
+ // extensions when we build a descriptor, at which point all protos have been
439
+ // parsed and so all extensions are known.
440
+ //
441
+ // Extension numbers for custom options may be chosen as follows:
442
+ // * For options which will only be used within a single application or
443
+ // organization, or for experimental options, use field numbers 50000
444
+ // through 99999. It is up to you to ensure that you do not use the
445
+ // same number for multiple options.
446
+ // * For options which will be published and used publicly by multiple
447
+ // independent entities, e-mail protobuf-global-extension-registry@google.com
448
+ // to reserve extension numbers. Simply provide your project name (e.g.
449
+ // Objective-C plugin) and your project website (if available) -- there's no
450
+ // need to explain how you intend to use them. Usually you only need one
451
+ // extension number. You can declare multiple options with only one extension
452
+ // number by putting them in a sub-message. See the Custom Options section of
453
+ // the docs for examples:
454
+ // https://developers.google.com/protocol-buffers/docs/proto#options
455
+ // If this turns out to be popular, a web service will be set up
456
+ // to automatically assign option numbers.
457
+
458
+ message FileOptions {
459
+
460
+ // Sets the Java package where classes generated from this .proto will be
461
+ // placed. By default, the proto package is used, but this is often
462
+ // inappropriate because proto packages do not normally start with backwards
463
+ // domain names.
464
+ optional string java_package = 1;
465
+
466
+ // Controls the name of the wrapper Java class generated for the .proto file.
467
+ // That class will always contain the .proto file's getDescriptor() method as
468
+ // well as any top-level extensions defined in the .proto file.
469
+ // If java_multiple_files is disabled, then all the other classes from the
470
+ // .proto file will be nested inside the single wrapper outer class.
471
+ optional string java_outer_classname = 8;
472
+
473
+ // If enabled, then the Java code generator will generate a separate .java
474
+ // file for each top-level message, enum, and service defined in the .proto
475
+ // file. Thus, these types will *not* be nested inside the wrapper class
476
+ // named by java_outer_classname. However, the wrapper class will still be
477
+ // generated to contain the file's getDescriptor() method as well as any
478
+ // top-level extensions defined in the file.
479
+ optional bool java_multiple_files = 10 [default = false];
480
+
481
+ // This option does nothing.
482
+ optional bool java_generate_equals_and_hash = 20 [deprecated=true];
483
+
484
+ // A proto2 file can set this to true to opt in to UTF-8 checking for Java,
485
+ // which will throw an exception if invalid UTF-8 is parsed from the wire or
486
+ // assigned to a string field.
487
+ //
488
+ // TODO: clarify exactly what kinds of field types this option
489
+ // applies to, and update these docs accordingly.
490
+ //
491
+ // Proto3 files already perform these checks. Setting the option explicitly to
492
+ // false has no effect: it cannot be used to opt proto3 files out of UTF-8
493
+ // checks.
494
+ optional bool java_string_check_utf8 = 27 [default = false];
495
+
496
+ // Generated classes can be optimized for speed or code size.
497
+ enum OptimizeMode {
498
+ SPEED = 1; // Generate complete code for parsing, serialization,
499
+ // etc.
500
+ CODE_SIZE = 2; // Use ReflectionOps to implement these methods.
501
+ LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.
502
+ }
503
+ optional OptimizeMode optimize_for = 9 [default = SPEED];
504
+
505
+ // Sets the Go package where structs generated from this .proto will be
506
+ // placed. If omitted, the Go package will be derived from the following:
507
+ // - The basename of the package import path, if provided.
508
+ // - Otherwise, the package statement in the .proto file, if present.
509
+ // - Otherwise, the basename of the .proto file, without extension.
510
+ optional string go_package = 11;
511
+
512
+ // Should generic services be generated in each language? "Generic" services
513
+ // are not specific to any particular RPC system. They are generated by the
514
+ // main code generators in each language (without additional plugins).
515
+ // Generic services were the only kind of service generation supported by
516
+ // early versions of google.protobuf.
517
+ //
518
+ // Generic services are now considered deprecated in favor of using plugins
519
+ // that generate code specific to your particular RPC system. Therefore,
520
+ // these default to false. Old code which depends on generic services should
521
+ // explicitly set them to true.
522
+ optional bool cc_generic_services = 16 [default = false];
523
+ optional bool java_generic_services = 17 [default = false];
524
+ optional bool py_generic_services = 18 [default = false];
525
+ reserved 42; // removed php_generic_services
526
+ reserved "php_generic_services";
527
+
528
+ // Is this file deprecated?
529
+ // Depending on the target platform, this can emit Deprecated annotations
530
+ // for everything in the file, or it will be completely ignored; in the very
531
+ // least, this is a formalization for deprecating files.
532
+ optional bool deprecated = 23 [default = false];
533
+
534
+ // Enables the use of arenas for the proto messages in this file. This applies
535
+ // only to generated classes for C++.
536
+ optional bool cc_enable_arenas = 31 [default = true];
537
+
538
+ // Sets the objective c class prefix which is prepended to all objective c
539
+ // generated classes from this .proto. There is no default.
540
+ optional string objc_class_prefix = 36;
541
+
542
+ // Namespace for generated classes; defaults to the package.
543
+ optional string csharp_namespace = 37;
544
+
545
+ // By default Swift generators will take the proto package and CamelCase it
546
+ // replacing '.' with underscore and use that to prefix the types/symbols
547
+ // defined. When this options is provided, they will use this value instead
548
+ // to prefix the types/symbols defined.
549
+ optional string swift_prefix = 39;
550
+
551
+ // Sets the php class prefix which is prepended to all php generated classes
552
+ // from this .proto. Default is empty.
553
+ optional string php_class_prefix = 40;
554
+
555
+ // Use this option to change the namespace of php generated classes. Default
556
+ // is empty. When this option is empty, the package name will be used for
557
+ // determining the namespace.
558
+ optional string php_namespace = 41;
559
+
560
+ // Use this option to change the namespace of php generated metadata classes.
561
+ // Default is empty. When this option is empty, the proto file name will be
562
+ // used for determining the namespace.
563
+ optional string php_metadata_namespace = 44;
564
+
565
+ // Use this option to change the package of ruby generated classes. Default
566
+ // is empty. When this option is not set, the package name will be used for
567
+ // determining the ruby package.
568
+ optional string ruby_package = 45;
569
+
570
+ // Any features defined in the specific edition.
571
+ // WARNING: This field should only be used by protobuf plugins or special
572
+ // cases like the proto compiler. Other uses are discouraged and
573
+ // developers should rely on the protoreflect APIs for their client language.
574
+ optional FeatureSet features = 50;
575
+
576
+ // The parser stores options it doesn't recognize here.
577
+ // See the documentation for the "Options" section above.
578
+ repeated UninterpretedOption uninterpreted_option = 999;
579
+
580
+ // Clients can define custom options in extensions of this message.
581
+ // See the documentation for the "Options" section above.
582
+ extensions 1000 to max;
583
+
584
+ reserved 38;
585
+ }
586
+
587
+ message MessageOptions {
588
+ // Set true to use the old proto1 MessageSet wire format for extensions.
589
+ // This is provided for backwards-compatibility with the MessageSet wire
590
+ // format. You should not use this for any other reason: It's less
591
+ // efficient, has fewer features, and is more complicated.
592
+ //
593
+ // The message must be defined exactly as follows:
594
+ // message Foo {
595
+ // option message_set_wire_format = true;
596
+ // extensions 4 to max;
597
+ // }
598
+ // Note that the message cannot have any defined fields; MessageSets only
599
+ // have extensions.
600
+ //
601
+ // All extensions of your type must be singular messages; e.g. they cannot
602
+ // be int32s, enums, or repeated messages.
603
+ //
604
+ // Because this is an option, the above two restrictions are not enforced by
605
+ // the protocol compiler.
606
+ optional bool message_set_wire_format = 1 [default = false];
607
+
608
+ // Disables the generation of the standard "descriptor()" accessor, which can
609
+ // conflict with a field of the same name. This is meant to make migration
610
+ // from proto1 easier; new code should avoid fields named "descriptor".
611
+ optional bool no_standard_descriptor_accessor = 2 [default = false];
612
+
613
+ // Is this message deprecated?
614
+ // Depending on the target platform, this can emit Deprecated annotations
615
+ // for the message, or it will be completely ignored; in the very least,
616
+ // this is a formalization for deprecating messages.
617
+ optional bool deprecated = 3 [default = false];
618
+
619
+ reserved 4, 5, 6;
620
+
621
+ // Whether the message is an automatically generated map entry type for the
622
+ // maps field.
623
+ //
624
+ // For maps fields:
625
+ // map<KeyType, ValueType> map_field = 1;
626
+ // The parsed descriptor looks like:
627
+ // message MapFieldEntry {
628
+ // option map_entry = true;
629
+ // optional KeyType key = 1;
630
+ // optional ValueType value = 2;
631
+ // }
632
+ // repeated MapFieldEntry map_field = 1;
633
+ //
634
+ // Implementations may choose not to generate the map_entry=true message, but
635
+ // use a native map in the target language to hold the keys and values.
636
+ // The reflection APIs in such implementations still need to work as
637
+ // if the field is a repeated message field.
638
+ //
639
+ // NOTE: Do not set the option in .proto files. Always use the maps syntax
640
+ // instead. The option should only be implicitly set by the proto compiler
641
+ // parser.
642
+ optional bool map_entry = 7;
643
+
644
+ reserved 8; // javalite_serializable
645
+ reserved 9; // javanano_as_lite
646
+
647
+ // Enable the legacy handling of JSON field name conflicts. This lowercases
648
+ // and strips underscored from the fields before comparison in proto3 only.
649
+ // The new behavior takes `json_name` into account and applies to proto2 as
650
+ // well.
651
+ //
652
+ // This should only be used as a temporary measure against broken builds due
653
+ // to the change in behavior for JSON field name conflicts.
654
+ //
655
+ // TODO This is legacy behavior we plan to remove once downstream
656
+ // teams have had time to migrate.
657
+ optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];
658
+
659
+ // Any features defined in the specific edition.
660
+ // WARNING: This field should only be used by protobuf plugins or special
661
+ // cases like the proto compiler. Other uses are discouraged and
662
+ // developers should rely on the protoreflect APIs for their client language.
663
+ optional FeatureSet features = 12;
664
+
665
+ // The parser stores options it doesn't recognize here. See above.
666
+ repeated UninterpretedOption uninterpreted_option = 999;
667
+
668
+ // Clients can define custom options in extensions of this message. See above.
669
+ extensions 1000 to max;
670
+ }
671
+
672
+ message FieldOptions {
673
+ // NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead.
674
+ // The ctype option instructs the C++ code generator to use a different
675
+ // representation of the field than it normally would. See the specific
676
+ // options below. This option is only implemented to support use of
677
+ // [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of
678
+ // type "bytes" in the open source release.
679
+ // TODO: make ctype actually deprecated.
680
+ optional CType ctype = 1 [/*deprecated = true,*/ default = STRING];
681
+ enum CType {
682
+ // Default mode.
683
+ STRING = 0;
684
+
685
+ // The option [ctype=CORD] may be applied to a non-repeated field of type
686
+ // "bytes". It indicates that in C++, the data should be stored in a Cord
687
+ // instead of a string. For very large strings, this may reduce memory
688
+ // fragmentation. It may also allow better performance when parsing from a
689
+ // Cord, or when parsing with aliasing enabled, as the parsed Cord may then
690
+ // alias the original buffer.
691
+ CORD = 1;
692
+
693
+ STRING_PIECE = 2;
694
+ }
695
+ // The packed option can be enabled for repeated primitive fields to enable
696
+ // a more efficient representation on the wire. Rather than repeatedly
697
+ // writing the tag and type for each element, the entire array is encoded as
698
+ // a single length-delimited blob. In proto3, only explicit setting it to
699
+ // false will avoid using packed encoding. This option is prohibited in
700
+ // Editions, but the `repeated_field_encoding` feature can be used to control
701
+ // the behavior.
702
+ optional bool packed = 2;
703
+
704
+ // The jstype option determines the JavaScript type used for values of the
705
+ // field. The option is permitted only for 64 bit integral and fixed types
706
+ // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING
707
+ // is represented as JavaScript string, which avoids loss of precision that
708
+ // can happen when a large value is converted to a floating point JavaScript.
709
+ // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
710
+ // use the JavaScript "number" type. The behavior of the default option
711
+ // JS_NORMAL is implementation dependent.
712
+ //
713
+ // This option is an enum to permit additional types to be added, e.g.
714
+ // goog.math.Integer.
715
+ optional JSType jstype = 6 [default = JS_NORMAL];
716
+ enum JSType {
717
+ // Use the default type.
718
+ JS_NORMAL = 0;
719
+
720
+ // Use JavaScript strings.
721
+ JS_STRING = 1;
722
+
723
+ // Use JavaScript numbers.
724
+ JS_NUMBER = 2;
725
+ }
726
+
727
+ // Should this field be parsed lazily? Lazy applies only to message-type
728
+ // fields. It means that when the outer message is initially parsed, the
729
+ // inner message's contents will not be parsed but instead stored in encoded
730
+ // form. The inner message will actually be parsed when it is first accessed.
731
+ //
732
+ // This is only a hint. Implementations are free to choose whether to use
733
+ // eager or lazy parsing regardless of the value of this option. However,
734
+ // setting this option true suggests that the protocol author believes that
735
+ // using lazy parsing on this field is worth the additional bookkeeping
736
+ // overhead typically needed to implement it.
737
+ //
738
+ // This option does not affect the public interface of any generated code;
739
+ // all method signatures remain the same. Furthermore, thread-safety of the
740
+ // interface is not affected by this option; const methods remain safe to
741
+ // call from multiple threads concurrently, while non-const methods continue
742
+ // to require exclusive access.
743
+ //
744
+ // Note that lazy message fields are still eagerly verified to check
745
+ // ill-formed wireformat or missing required fields. Calling IsInitialized()
746
+ // on the outer message would fail if the inner message has missing required
747
+ // fields. Failed verification would result in parsing failure (except when
748
+ // uninitialized messages are acceptable).
749
+ optional bool lazy = 5 [default = false];
750
+
751
+ // unverified_lazy does no correctness checks on the byte stream. This should
752
+ // only be used where lazy with verification is prohibitive for performance
753
+ // reasons.
754
+ optional bool unverified_lazy = 15 [default = false];
755
+
756
+ // Is this field deprecated?
757
+ // Depending on the target platform, this can emit Deprecated annotations
758
+ // for accessors, or it will be completely ignored; in the very least, this
759
+ // is a formalization for deprecating fields.
760
+ optional bool deprecated = 3 [default = false];
761
+
762
+ // DEPRECATED. DO NOT USE!
763
+ // For Google-internal migration only. Do not use.
764
+ optional bool weak = 10 [default = false, deprecated = true];
765
+
766
+ // Indicate that the field value should not be printed out when using debug
767
+ // formats, e.g. when the field contains sensitive credentials.
768
+ optional bool debug_redact = 16 [default = false];
769
+
770
+ // If set to RETENTION_SOURCE, the option will be omitted from the binary.
771
+ enum OptionRetention {
772
+ RETENTION_UNKNOWN = 0;
773
+ RETENTION_RUNTIME = 1;
774
+ RETENTION_SOURCE = 2;
775
+ }
776
+
777
+ optional OptionRetention retention = 17;
778
+
779
+ // This indicates the types of entities that the field may apply to when used
780
+ // as an option. If it is unset, then the field may be freely used as an
781
+ // option on any kind of entity.
782
+ enum OptionTargetType {
783
+ TARGET_TYPE_UNKNOWN = 0;
784
+ TARGET_TYPE_FILE = 1;
785
+ TARGET_TYPE_EXTENSION_RANGE = 2;
786
+ TARGET_TYPE_MESSAGE = 3;
787
+ TARGET_TYPE_FIELD = 4;
788
+ TARGET_TYPE_ONEOF = 5;
789
+ TARGET_TYPE_ENUM = 6;
790
+ TARGET_TYPE_ENUM_ENTRY = 7;
791
+ TARGET_TYPE_SERVICE = 8;
792
+ TARGET_TYPE_METHOD = 9;
793
+ }
794
+
795
+ repeated OptionTargetType targets = 19;
796
+
797
+ message EditionDefault {
798
+ optional Edition edition = 3;
799
+ optional string value = 2; // Textproto value.
800
+ }
801
+ repeated EditionDefault edition_defaults = 20;
802
+
803
+ // Any features defined in the specific edition.
804
+ // WARNING: This field should only be used by protobuf plugins or special
805
+ // cases like the proto compiler. Other uses are discouraged and
806
+ // developers should rely on the protoreflect APIs for their client language.
807
+ optional FeatureSet features = 21;
808
+
809
+ // Information about the support window of a feature.
810
+ message FeatureSupport {
811
+ // The edition that this feature was first available in. In editions
812
+ // earlier than this one, the default assigned to EDITION_LEGACY will be
813
+ // used, and proto files will not be able to override it.
814
+ optional Edition edition_introduced = 1;
815
+
816
+ // The edition this feature becomes deprecated in. Using this after this
817
+ // edition may trigger warnings.
818
+ optional Edition edition_deprecated = 2;
819
+
820
+ // The deprecation warning text if this feature is used after the edition it
821
+ // was marked deprecated in.
822
+ optional string deprecation_warning = 3;
823
+
824
+ // The edition this feature is no longer available in. In editions after
825
+ // this one, the last default assigned will be used, and proto files will
826
+ // not be able to override it.
827
+ optional Edition edition_removed = 4;
828
+ }
829
+ optional FeatureSupport feature_support = 22;
830
+
831
+ // The parser stores options it doesn't recognize here. See above.
832
+ repeated UninterpretedOption uninterpreted_option = 999;
833
+
834
+ // Clients can define custom options in extensions of this message. See above.
835
+ extensions 1000 to max;
836
+
837
+ reserved 4; // removed jtype
838
+ reserved 18; // reserve target, target_obsolete_do_not_use
839
+ }
840
+
841
+ message OneofOptions {
842
+ // Any features defined in the specific edition.
843
+ // WARNING: This field should only be used by protobuf plugins or special
844
+ // cases like the proto compiler. Other uses are discouraged and
845
+ // developers should rely on the protoreflect APIs for their client language.
846
+ optional FeatureSet features = 1;
847
+
848
+ // The parser stores options it doesn't recognize here. See above.
849
+ repeated UninterpretedOption uninterpreted_option = 999;
850
+
851
+ // Clients can define custom options in extensions of this message. See above.
852
+ extensions 1000 to max;
853
+ }
854
+
855
+ message EnumOptions {
856
+
857
+ // Set this option to true to allow mapping different tag names to the same
858
+ // value.
859
+ optional bool allow_alias = 2;
860
+
861
+ // Is this enum deprecated?
862
+ // Depending on the target platform, this can emit Deprecated annotations
863
+ // for the enum, or it will be completely ignored; in the very least, this
864
+ // is a formalization for deprecating enums.
865
+ optional bool deprecated = 3 [default = false];
866
+
867
+ reserved 5; // javanano_as_lite
868
+
869
+ // Enable the legacy handling of JSON field name conflicts. This lowercases
870
+ // and strips underscored from the fields before comparison in proto3 only.
871
+ // The new behavior takes `json_name` into account and applies to proto2 as
872
+ // well.
873
+ // TODO Remove this legacy behavior once downstream teams have
874
+ // had time to migrate.
875
+ optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];
876
+
877
+ // Any features defined in the specific edition.
878
+ // WARNING: This field should only be used by protobuf plugins or special
879
+ // cases like the proto compiler. Other uses are discouraged and
880
+ // developers should rely on the protoreflect APIs for their client language.
881
+ optional FeatureSet features = 7;
882
+
883
+ // The parser stores options it doesn't recognize here. See above.
884
+ repeated UninterpretedOption uninterpreted_option = 999;
885
+
886
+ // Clients can define custom options in extensions of this message. See above.
887
+ extensions 1000 to max;
888
+ }
889
+
890
+ message EnumValueOptions {
891
+ // Is this enum value deprecated?
892
+ // Depending on the target platform, this can emit Deprecated annotations
893
+ // for the enum value, or it will be completely ignored; in the very least,
894
+ // this is a formalization for deprecating enum values.
895
+ optional bool deprecated = 1 [default = false];
896
+
897
+ // Any features defined in the specific edition.
898
+ // WARNING: This field should only be used by protobuf plugins or special
899
+ // cases like the proto compiler. Other uses are discouraged and
900
+ // developers should rely on the protoreflect APIs for their client language.
901
+ optional FeatureSet features = 2;
902
+
903
+ // Indicate that fields annotated with this enum value should not be printed
904
+ // out when using debug formats, e.g. when the field contains sensitive
905
+ // credentials.
906
+ optional bool debug_redact = 3 [default = false];
907
+
908
+ // Information about the support window of a feature value.
909
+ optional FieldOptions.FeatureSupport feature_support = 4;
910
+
911
+ // The parser stores options it doesn't recognize here. See above.
912
+ repeated UninterpretedOption uninterpreted_option = 999;
913
+
914
+ // Clients can define custom options in extensions of this message. See above.
915
+ extensions 1000 to max;
916
+ }
917
+
918
+ message ServiceOptions {
919
+
920
+ // Any features defined in the specific edition.
921
+ // WARNING: This field should only be used by protobuf plugins or special
922
+ // cases like the proto compiler. Other uses are discouraged and
923
+ // developers should rely on the protoreflect APIs for their client language.
924
+ optional FeatureSet features = 34;
925
+
926
+ // Note: Field numbers 1 through 32 are reserved for Google's internal RPC
927
+ // framework. We apologize for hoarding these numbers to ourselves, but
928
+ // we were already using them long before we decided to release Protocol
929
+ // Buffers.
930
+
931
+ // Is this service deprecated?
932
+ // Depending on the target platform, this can emit Deprecated annotations
933
+ // for the service, or it will be completely ignored; in the very least,
934
+ // this is a formalization for deprecating services.
935
+ optional bool deprecated = 33 [default = false];
936
+
937
+ // The parser stores options it doesn't recognize here. See above.
938
+ repeated UninterpretedOption uninterpreted_option = 999;
939
+
940
+ // Clients can define custom options in extensions of this message. See above.
941
+ extensions 1000 to max;
942
+ }
943
+
944
+ message MethodOptions {
945
+
946
+ // Note: Field numbers 1 through 32 are reserved for Google's internal RPC
947
+ // framework. We apologize for hoarding these numbers to ourselves, but
948
+ // we were already using them long before we decided to release Protocol
949
+ // Buffers.
950
+
951
+ // Is this method deprecated?
952
+ // Depending on the target platform, this can emit Deprecated annotations
953
+ // for the method, or it will be completely ignored; in the very least,
954
+ // this is a formalization for deprecating methods.
955
+ optional bool deprecated = 33 [default = false];
956
+
957
+ // Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
958
+ // or neither? HTTP based RPC implementation may choose GET verb for safe
959
+ // methods, and PUT verb for idempotent methods instead of the default POST.
960
+ enum IdempotencyLevel {
961
+ IDEMPOTENCY_UNKNOWN = 0;
962
+ NO_SIDE_EFFECTS = 1; // implies idempotent
963
+ IDEMPOTENT = 2; // idempotent, but may have side effects
964
+ }
965
+ optional IdempotencyLevel idempotency_level = 34
966
+ [default = IDEMPOTENCY_UNKNOWN];
967
+
968
+ // Any features defined in the specific edition.
969
+ // WARNING: This field should only be used by protobuf plugins or special
970
+ // cases like the proto compiler. Other uses are discouraged and
971
+ // developers should rely on the protoreflect APIs for their client language.
972
+ optional FeatureSet features = 35;
973
+
974
+ // The parser stores options it doesn't recognize here. See above.
975
+ repeated UninterpretedOption uninterpreted_option = 999;
976
+
977
+ // Clients can define custom options in extensions of this message. See above.
978
+ extensions 1000 to max;
979
+ }
980
+
981
+ // A message representing a option the parser does not recognize. This only
982
+ // appears in options protos created by the compiler::Parser class.
983
+ // DescriptorPool resolves these when building Descriptor objects. Therefore,
984
+ // options protos in descriptor objects (e.g. returned by Descriptor::options(),
985
+ // or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
986
+ // in them.
987
+ message UninterpretedOption {
988
+ // The name of the uninterpreted option. Each string represents a segment in
989
+ // a dot-separated name. is_extension is true iff a segment represents an
990
+ // extension (denoted with parentheses in options specs in .proto files).
991
+ // E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents
992
+ // "foo.(bar.baz).moo".
993
+ message NamePart {
994
+ required string name_part = 1;
995
+ required bool is_extension = 2;
996
+ }
997
+ repeated NamePart name = 2;
998
+
999
+ // The value of the uninterpreted option, in whatever type the tokenizer
1000
+ // identified it as during parsing. Exactly one of these should be set.
1001
+ optional string identifier_value = 3;
1002
+ optional uint64 positive_int_value = 4;
1003
+ optional int64 negative_int_value = 5;
1004
+ optional double double_value = 6;
1005
+ optional bytes string_value = 7;
1006
+ optional string aggregate_value = 8;
1007
+ }
1008
+
1009
+ // ===================================================================
1010
+ // Features
1011
+
1012
+ // TODO Enums in C++ gencode (and potentially other languages) are
1013
+ // not well scoped. This means that each of the feature enums below can clash
1014
+ // with each other. The short names we've chosen maximize call-site
1015
+ // readability, but leave us very open to this scenario. A future feature will
1016
+ // be designed and implemented to handle this, hopefully before we ever hit a
1017
+ // conflict here.
1018
+ message FeatureSet {
1019
+ enum FieldPresence {
1020
+ FIELD_PRESENCE_UNKNOWN = 0;
1021
+ EXPLICIT = 1;
1022
+ IMPLICIT = 2;
1023
+ LEGACY_REQUIRED = 3;
1024
+ }
1025
+ optional FieldPresence field_presence = 1 [
1026
+ retention = RETENTION_RUNTIME,
1027
+ targets = TARGET_TYPE_FIELD,
1028
+ targets = TARGET_TYPE_FILE,
1029
+ feature_support = {
1030
+ edition_introduced: EDITION_2023,
1031
+ },
1032
+ edition_defaults = { edition: EDITION_LEGACY, value: "EXPLICIT" },
1033
+ edition_defaults = { edition: EDITION_PROTO3, value: "IMPLICIT" },
1034
+ edition_defaults = { edition: EDITION_2023, value: "EXPLICIT" }
1035
+ ];
1036
+
1037
+ enum EnumType {
1038
+ ENUM_TYPE_UNKNOWN = 0;
1039
+ OPEN = 1;
1040
+ CLOSED = 2;
1041
+ }
1042
+ optional EnumType enum_type = 2 [
1043
+ retention = RETENTION_RUNTIME,
1044
+ targets = TARGET_TYPE_ENUM,
1045
+ targets = TARGET_TYPE_FILE,
1046
+ feature_support = {
1047
+ edition_introduced: EDITION_2023,
1048
+ },
1049
+ edition_defaults = { edition: EDITION_LEGACY, value: "CLOSED" },
1050
+ edition_defaults = { edition: EDITION_PROTO3, value: "OPEN" }
1051
+ ];
1052
+
1053
+ enum RepeatedFieldEncoding {
1054
+ REPEATED_FIELD_ENCODING_UNKNOWN = 0;
1055
+ PACKED = 1;
1056
+ EXPANDED = 2;
1057
+ }
1058
+ optional RepeatedFieldEncoding repeated_field_encoding = 3 [
1059
+ retention = RETENTION_RUNTIME,
1060
+ targets = TARGET_TYPE_FIELD,
1061
+ targets = TARGET_TYPE_FILE,
1062
+ feature_support = {
1063
+ edition_introduced: EDITION_2023,
1064
+ },
1065
+ edition_defaults = { edition: EDITION_LEGACY, value: "EXPANDED" },
1066
+ edition_defaults = { edition: EDITION_PROTO3, value: "PACKED" }
1067
+ ];
1068
+
1069
+ enum Utf8Validation {
1070
+ UTF8_VALIDATION_UNKNOWN = 0;
1071
+ VERIFY = 2;
1072
+ NONE = 3;
1073
+ reserved 1;
1074
+ }
1075
+ optional Utf8Validation utf8_validation = 4 [
1076
+ retention = RETENTION_RUNTIME,
1077
+ targets = TARGET_TYPE_FIELD,
1078
+ targets = TARGET_TYPE_FILE,
1079
+ feature_support = {
1080
+ edition_introduced: EDITION_2023,
1081
+ },
1082
+ edition_defaults = { edition: EDITION_LEGACY, value: "NONE" },
1083
+ edition_defaults = { edition: EDITION_PROTO3, value: "VERIFY" }
1084
+ ];
1085
+
1086
+ enum MessageEncoding {
1087
+ MESSAGE_ENCODING_UNKNOWN = 0;
1088
+ LENGTH_PREFIXED = 1;
1089
+ DELIMITED = 2;
1090
+ }
1091
+ optional MessageEncoding message_encoding = 5 [
1092
+ retention = RETENTION_RUNTIME,
1093
+ targets = TARGET_TYPE_FIELD,
1094
+ targets = TARGET_TYPE_FILE,
1095
+ feature_support = {
1096
+ edition_introduced: EDITION_2023,
1097
+ },
1098
+ edition_defaults = { edition: EDITION_LEGACY, value: "LENGTH_PREFIXED" }
1099
+ ];
1100
+
1101
+ enum JsonFormat {
1102
+ JSON_FORMAT_UNKNOWN = 0;
1103
+ ALLOW = 1;
1104
+ LEGACY_BEST_EFFORT = 2;
1105
+ }
1106
+ optional JsonFormat json_format = 6 [
1107
+ retention = RETENTION_RUNTIME,
1108
+ targets = TARGET_TYPE_MESSAGE,
1109
+ targets = TARGET_TYPE_ENUM,
1110
+ targets = TARGET_TYPE_FILE,
1111
+ feature_support = {
1112
+ edition_introduced: EDITION_2023,
1113
+ },
1114
+ edition_defaults = { edition: EDITION_LEGACY, value: "LEGACY_BEST_EFFORT" },
1115
+ edition_defaults = { edition: EDITION_PROTO3, value: "ALLOW" }
1116
+ ];
1117
+
1118
+ enum EnforceNamingStyle {
1119
+ ENFORCE_NAMING_STYLE_UNKNOWN = 0;
1120
+ STYLE2024 = 1;
1121
+ STYLE_LEGACY = 2;
1122
+ }
1123
+ optional EnforceNamingStyle enforce_naming_style = 7 [
1124
+ retention = RETENTION_SOURCE,
1125
+ targets = TARGET_TYPE_FILE,
1126
+ targets = TARGET_TYPE_EXTENSION_RANGE,
1127
+ targets = TARGET_TYPE_MESSAGE,
1128
+ targets = TARGET_TYPE_FIELD,
1129
+ targets = TARGET_TYPE_ONEOF,
1130
+ targets = TARGET_TYPE_ENUM,
1131
+ targets = TARGET_TYPE_ENUM_ENTRY,
1132
+ targets = TARGET_TYPE_SERVICE,
1133
+ targets = TARGET_TYPE_METHOD,
1134
+ feature_support = {
1135
+ edition_introduced: EDITION_2024,
1136
+ },
1137
+ edition_defaults = { edition: EDITION_LEGACY, value: "STYLE_LEGACY" },
1138
+ edition_defaults = { edition: EDITION_2024, value: "STYLE2024" }
1139
+ ];
1140
+
1141
+ message VisibilityFeature {
1142
+ enum DefaultSymbolVisibility {
1143
+ DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;
1144
+
1145
+ // Default pre-EDITION_2024, all UNSET visibility are export.
1146
+ EXPORT_ALL = 1;
1147
+
1148
+ // All top-level symbols default to export, nested default to local.
1149
+ EXPORT_TOP_LEVEL = 2;
1150
+
1151
+ // All symbols default to local.
1152
+ LOCAL_ALL = 3;
1153
+
1154
+ // All symbols local by default. Nested types cannot be exported.
1155
+ // With special case caveat for message { enum {} reserved 1 to max; }
1156
+ // This is the recommended setting for new protos.
1157
+ STRICT = 4;
1158
+ }
1159
+ reserved 1 to max;
1160
+ }
1161
+ optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility =
1162
+ 8 [
1163
+ retention = RETENTION_SOURCE,
1164
+ targets = TARGET_TYPE_FILE,
1165
+ feature_support = {
1166
+ edition_introduced: EDITION_2024,
1167
+ },
1168
+ edition_defaults = { edition: EDITION_LEGACY, value: "EXPORT_ALL" },
1169
+ edition_defaults = { edition: EDITION_2024, value: "EXPORT_TOP_LEVEL" }
1170
+ ];
1171
+
1172
+ reserved 999;
1173
+
1174
+ extensions 1000 to 9994 [
1175
+ declaration = {
1176
+ number: 1000,
1177
+ full_name: ".pb.cpp",
1178
+ type: ".pb.CppFeatures"
1179
+ },
1180
+ declaration = {
1181
+ number: 1001,
1182
+ full_name: ".pb.java",
1183
+ type: ".pb.JavaFeatures"
1184
+ },
1185
+ declaration = { number: 1002, full_name: ".pb.go", type: ".pb.GoFeatures" },
1186
+ declaration = {
1187
+ number: 1003,
1188
+ full_name: ".pb.python",
1189
+ type: ".pb.PythonFeatures"
1190
+ },
1191
+ declaration = {
1192
+ number: 1100,
1193
+ full_name: ".imp.impress_feature_set",
1194
+ type: ".imp.ImpressFeatureSet"
1195
+ },
1196
+ declaration = {
1197
+ number: 9989,
1198
+ full_name: ".pb.java_mutable",
1199
+ type: ".pb.JavaMutableFeatures"
1200
+ },
1201
+ declaration = {
1202
+ number: 9990,
1203
+ full_name: ".pb.proto1",
1204
+ type: ".pb.Proto1Features"
1205
+ }
1206
+ ];
1207
+
1208
+ extensions 9995 to 9999; // For internal testing
1209
+ extensions 10000; // for https://github.com/bufbuild/protobuf-es
1210
+ }
1211
+
1212
+ // A compiled specification for the defaults of a set of features. These
1213
+ // messages are generated from FeatureSet extensions and can be used to seed
1214
+ // feature resolution. The resolution with this object becomes a simple search
1215
+ // for the closest matching edition, followed by proto merges.
1216
+ message FeatureSetDefaults {
1217
+ // A map from every known edition with a unique set of defaults to its
1218
+ // defaults. Not all editions may be contained here. For a given edition,
1219
+ // the defaults at the closest matching edition ordered at or before it should
1220
+ // be used. This field must be in strict ascending order by edition.
1221
+ message FeatureSetEditionDefault {
1222
+ optional Edition edition = 3;
1223
+
1224
+ // Defaults of features that can be overridden in this edition.
1225
+ optional FeatureSet overridable_features = 4;
1226
+
1227
+ // Defaults of features that can't be overridden in this edition.
1228
+ optional FeatureSet fixed_features = 5;
1229
+
1230
+ reserved 1, 2;
1231
+ reserved "features";
1232
+ }
1233
+ repeated FeatureSetEditionDefault defaults = 1;
1234
+
1235
+ // The minimum supported edition (inclusive) when this was constructed.
1236
+ // Editions before this will not have defaults.
1237
+ optional Edition minimum_edition = 4;
1238
+
1239
+ // The maximum known edition (inclusive) when this was constructed. Editions
1240
+ // after this will not have reliable defaults.
1241
+ optional Edition maximum_edition = 5;
1242
+ }
1243
+
1244
+ // ===================================================================
1245
+ // Optional source code info
1246
+
1247
+ // Encapsulates information about the original source file from which a
1248
+ // FileDescriptorProto was generated.
1249
+ message SourceCodeInfo {
1250
+ // A Location identifies a piece of source code in a .proto file which
1251
+ // corresponds to a particular definition. This information is intended
1252
+ // to be useful to IDEs, code indexers, documentation generators, and similar
1253
+ // tools.
1254
+ //
1255
+ // For example, say we have a file like:
1256
+ // message Foo {
1257
+ // optional string foo = 1;
1258
+ // }
1259
+ // Let's look at just the field definition:
1260
+ // optional string foo = 1;
1261
+ // ^ ^^ ^^ ^ ^^^
1262
+ // a bc de f ghi
1263
+ // We have the following locations:
1264
+ // span path represents
1265
+ // [a,i) [ 4, 0, 2, 0 ] The whole field definition.
1266
+ // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
1267
+ // [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
1268
+ // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
1269
+ // [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
1270
+ //
1271
+ // Notes:
1272
+ // - A location may refer to a repeated field itself (i.e. not to any
1273
+ // particular index within it). This is used whenever a set of elements are
1274
+ // logically enclosed in a single code segment. For example, an entire
1275
+ // extend block (possibly containing multiple extension definitions) will
1276
+ // have an outer location whose path refers to the "extensions" repeated
1277
+ // field without an index.
1278
+ // - Multiple locations may have the same path. This happens when a single
1279
+ // logical declaration is spread out across multiple places. The most
1280
+ // obvious example is the "extend" block again -- there may be multiple
1281
+ // extend blocks in the same scope, each of which will have the same path.
1282
+ // - A location's span is not always a subset of its parent's span. For
1283
+ // example, the "extendee" of an extension declaration appears at the
1284
+ // beginning of the "extend" block and is shared by all extensions within
1285
+ // the block.
1286
+ // - Just because a location's span is a subset of some other location's span
1287
+ // does not mean that it is a descendant. For example, a "group" defines
1288
+ // both a type and a field in a single declaration. Thus, the locations
1289
+ // corresponding to the type and field and their components will overlap.
1290
+ // - Code which tries to interpret locations should probably be designed to
1291
+ // ignore those that it doesn't understand, as more types of locations could
1292
+ // be recorded in the future.
1293
+ repeated Location location = 1;
1294
+ message Location {
1295
+ // Identifies which part of the FileDescriptorProto was defined at this
1296
+ // location.
1297
+ //
1298
+ // Each element is a field number or an index. They form a path from
1299
+ // the root FileDescriptorProto to the place where the definition appears.
1300
+ // For example, this path:
1301
+ // [ 4, 3, 2, 7, 1 ]
1302
+ // refers to:
1303
+ // file.message_type(3) // 4, 3
1304
+ // .field(7) // 2, 7
1305
+ // .name() // 1
1306
+ // This is because FileDescriptorProto.message_type has field number 4:
1307
+ // repeated DescriptorProto message_type = 4;
1308
+ // and DescriptorProto.field has field number 2:
1309
+ // repeated FieldDescriptorProto field = 2;
1310
+ // and FieldDescriptorProto.name has field number 1:
1311
+ // optional string name = 1;
1312
+ //
1313
+ // Thus, the above path gives the location of a field name. If we removed
1314
+ // the last element:
1315
+ // [ 4, 3, 2, 7 ]
1316
+ // this path refers to the whole field declaration (from the beginning
1317
+ // of the label to the terminating semicolon).
1318
+ repeated int32 path = 1 [packed = true];
1319
+
1320
+ // Always has exactly three or four elements: start line, start column,
1321
+ // end line (optional, otherwise assumed same as start line), end column.
1322
+ // These are packed into a single field for efficiency. Note that line
1323
+ // and column numbers are zero-based -- typically you will want to add
1324
+ // 1 to each before displaying to a user.
1325
+ repeated int32 span = 2 [packed = true];
1326
+
1327
+ // If this SourceCodeInfo represents a complete declaration, these are any
1328
+ // comments appearing before and after the declaration which appear to be
1329
+ // attached to the declaration.
1330
+ //
1331
+ // A series of line comments appearing on consecutive lines, with no other
1332
+ // tokens appearing on those lines, will be treated as a single comment.
1333
+ //
1334
+ // leading_detached_comments will keep paragraphs of comments that appear
1335
+ // before (but not connected to) the current element. Each paragraph,
1336
+ // separated by empty lines, will be one comment element in the repeated
1337
+ // field.
1338
+ //
1339
+ // Only the comment content is provided; comment markers (e.g. //) are
1340
+ // stripped out. For block comments, leading whitespace and an asterisk
1341
+ // will be stripped from the beginning of each line other than the first.
1342
+ // Newlines are included in the output.
1343
+ //
1344
+ // Examples:
1345
+ //
1346
+ // optional int32 foo = 1; // Comment attached to foo.
1347
+ // // Comment attached to bar.
1348
+ // optional int32 bar = 2;
1349
+ //
1350
+ // optional string baz = 3;
1351
+ // // Comment attached to baz.
1352
+ // // Another line attached to baz.
1353
+ //
1354
+ // // Comment attached to moo.
1355
+ // //
1356
+ // // Another line attached to moo.
1357
+ // optional double moo = 4;
1358
+ //
1359
+ // // Detached comment for corge. This is not leading or trailing comments
1360
+ // // to moo or corge because there are blank lines separating it from
1361
+ // // both.
1362
+ //
1363
+ // // Detached comment for corge paragraph 2.
1364
+ //
1365
+ // optional string corge = 5;
1366
+ // /* Block comment attached
1367
+ // * to corge. Leading asterisks
1368
+ // * will be removed. */
1369
+ // /* Block comment attached to
1370
+ // * grault. */
1371
+ // optional int32 grault = 6;
1372
+ //
1373
+ // // ignored detached comments.
1374
+ optional string leading_comments = 3;
1375
+ optional string trailing_comments = 4;
1376
+ repeated string leading_detached_comments = 6;
1377
+ }
1378
+
1379
+ // Extensions for tooling.
1380
+ extensions 536000000 [declaration = {
1381
+ number: 536000000
1382
+ type: ".buf.descriptor.v1.SourceCodeInfoExtension"
1383
+ full_name: ".buf.descriptor.v1.buf_source_code_info_extension"
1384
+ }];
1385
+ }
1386
+
1387
+ // Describes the relationship between generated code and its original source
1388
+ // file. A GeneratedCodeInfo message is associated with only one generated
1389
+ // source file, but may contain references to different source .proto files.
1390
+ message GeneratedCodeInfo {
1391
+ // An Annotation connects some span of text in generated code to an element
1392
+ // of its generating .proto file.
1393
+ repeated Annotation annotation = 1;
1394
+ message Annotation {
1395
+ // Identifies the element in the original source .proto file. This field
1396
+ // is formatted the same as SourceCodeInfo.Location.path.
1397
+ repeated int32 path = 1 [packed = true];
1398
+
1399
+ // Identifies the filesystem path to the original source .proto.
1400
+ optional string source_file = 2;
1401
+
1402
+ // Identifies the starting offset in bytes in the generated code
1403
+ // that relates to the identified object.
1404
+ optional int32 begin = 3;
1405
+
1406
+ // Identifies the ending offset in bytes in the generated code that
1407
+ // relates to the identified object. The end offset should be one past
1408
+ // the last relevant byte (so the length of the text = end - begin).
1409
+ optional int32 end = 4;
1410
+
1411
+ // Represents the identified object's effect on the element in the original
1412
+ // .proto file.
1413
+ enum Semantic {
1414
+ // There is no effect or the effect is indescribable.
1415
+ NONE = 0;
1416
+ // The element is set or otherwise mutated.
1417
+ SET = 1;
1418
+ // An alias to the element is returned.
1419
+ ALIAS = 2;
1420
+ }
1421
+ optional Semantic semantic = 5;
1422
+ }
1423
+ }
1424
+
1425
+ // Describes the 'visibility' of a symbol with respect to the proto import
1426
+ // system. Symbols can only be imported when the visibility rules do not prevent
1427
+ // it (ex: local symbols cannot be imported). Visibility modifiers can only set
1428
+ // on `message` and `enum` as they are the only types available to be referenced
1429
+ // from other files.
1430
+ enum SymbolVisibility {
1431
+ VISIBILITY_UNSET = 0;
1432
+ VISIBILITY_LOCAL = 1;
1433
+ VISIBILITY_EXPORT = 2;
1434
+ }