github.com/jhump/protoreflect@v1.16.0/desc/protoprint/testfiles/descriptor-sorted-AND-multiline-style-comments.proto (about)

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