Warning, /include/google/protobuf/type.proto is written in an unsupported language. File is not indexed.
0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2008 Google Inc. All rights reserved.
0003 // https://developers.google.com/protocol-buffers/
0004 //
0005 // Redistribution and use in source and binary forms, with or without
0006 // modification, are permitted provided that the following conditions are
0007 // met:
0008 //
0009 // * Redistributions of source code must retain the above copyright
0010 // notice, this list of conditions and the following disclaimer.
0011 // * Redistributions in binary form must reproduce the above
0012 // copyright notice, this list of conditions and the following disclaimer
0013 // in the documentation and/or other materials provided with the
0014 // distribution.
0015 // * Neither the name of Google Inc. nor the names of its
0016 // contributors may be used to endorse or promote products derived from
0017 // this software without specific prior written permission.
0018 //
0019 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0020 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0021 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0022 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0023 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0024 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0025 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0026 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0027 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0028 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0029 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0030
0031 syntax = "proto3";
0032
0033 package google.protobuf;
0034
0035 import "google/protobuf/any.proto";
0036 import "google/protobuf/source_context.proto";
0037
0038 option cc_enable_arenas = true;
0039 option java_package = "com.google.protobuf";
0040 option java_outer_classname = "TypeProto";
0041 option java_multiple_files = true;
0042 option objc_class_prefix = "GPB";
0043 option csharp_namespace = "Google.Protobuf.WellKnownTypes";
0044 option go_package = "google.golang.org/protobuf/types/known/typepb";
0045
0046 // A protocol buffer message type.
0047 message Type {
0048 // The fully qualified message name.
0049 string name = 1;
0050 // The list of fields.
0051 repeated Field fields = 2;
0052 // The list of types appearing in `oneof` definitions in this type.
0053 repeated string oneofs = 3;
0054 // The protocol buffer options.
0055 repeated Option options = 4;
0056 // The source context.
0057 SourceContext source_context = 5;
0058 // The source syntax.
0059 Syntax syntax = 6;
0060 // The source edition string, only valid when syntax is SYNTAX_EDITIONS.
0061 string edition = 7;
0062 }
0063
0064 // A single field of a message type.
0065 message Field {
0066 // Basic field types.
0067 enum Kind {
0068 // Field type unknown.
0069 TYPE_UNKNOWN = 0;
0070 // Field type double.
0071 TYPE_DOUBLE = 1;
0072 // Field type float.
0073 TYPE_FLOAT = 2;
0074 // Field type int64.
0075 TYPE_INT64 = 3;
0076 // Field type uint64.
0077 TYPE_UINT64 = 4;
0078 // Field type int32.
0079 TYPE_INT32 = 5;
0080 // Field type fixed64.
0081 TYPE_FIXED64 = 6;
0082 // Field type fixed32.
0083 TYPE_FIXED32 = 7;
0084 // Field type bool.
0085 TYPE_BOOL = 8;
0086 // Field type string.
0087 TYPE_STRING = 9;
0088 // Field type group. Proto2 syntax only, and deprecated.
0089 TYPE_GROUP = 10;
0090 // Field type message.
0091 TYPE_MESSAGE = 11;
0092 // Field type bytes.
0093 TYPE_BYTES = 12;
0094 // Field type uint32.
0095 TYPE_UINT32 = 13;
0096 // Field type enum.
0097 TYPE_ENUM = 14;
0098 // Field type sfixed32.
0099 TYPE_SFIXED32 = 15;
0100 // Field type sfixed64.
0101 TYPE_SFIXED64 = 16;
0102 // Field type sint32.
0103 TYPE_SINT32 = 17;
0104 // Field type sint64.
0105 TYPE_SINT64 = 18;
0106 }
0107
0108 // Whether a field is optional, required, or repeated.
0109 enum Cardinality {
0110 // For fields with unknown cardinality.
0111 CARDINALITY_UNKNOWN = 0;
0112 // For optional fields.
0113 CARDINALITY_OPTIONAL = 1;
0114 // For required fields. Proto2 syntax only.
0115 CARDINALITY_REQUIRED = 2;
0116 // For repeated fields.
0117 CARDINALITY_REPEATED = 3;
0118 }
0119
0120 // The field type.
0121 Kind kind = 1;
0122 // The field cardinality.
0123 Cardinality cardinality = 2;
0124 // The field number.
0125 int32 number = 3;
0126 // The field name.
0127 string name = 4;
0128 // The field type URL, without the scheme, for message or enumeration
0129 // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
0130 string type_url = 6;
0131 // The index of the field type in `Type.oneofs`, for message or enumeration
0132 // types. The first type has index 1; zero means the type is not in the list.
0133 int32 oneof_index = 7;
0134 // Whether to use alternative packed wire representation.
0135 bool packed = 8;
0136 // The protocol buffer options.
0137 repeated Option options = 9;
0138 // The field JSON name.
0139 string json_name = 10;
0140 // The string value of the default value of this field. Proto2 syntax only.
0141 string default_value = 11;
0142 }
0143
0144 // Enum type definition.
0145 message Enum {
0146 // Enum type name.
0147 string name = 1;
0148 // Enum value definitions.
0149 repeated EnumValue enumvalue = 2;
0150 // Protocol buffer options.
0151 repeated Option options = 3;
0152 // The source context.
0153 SourceContext source_context = 4;
0154 // The source syntax.
0155 Syntax syntax = 5;
0156 // The source edition string, only valid when syntax is SYNTAX_EDITIONS.
0157 string edition = 6;
0158 }
0159
0160 // Enum value definition.
0161 message EnumValue {
0162 // Enum value name.
0163 string name = 1;
0164 // Enum value number.
0165 int32 number = 2;
0166 // Protocol buffer options.
0167 repeated Option options = 3;
0168 }
0169
0170 // A protocol buffer option, which can be attached to a message, field,
0171 // enumeration, etc.
0172 message Option {
0173 // The option's name. For protobuf built-in options (options defined in
0174 // descriptor.proto), this is the short name. For example, `"map_entry"`.
0175 // For custom options, it should be the fully-qualified name. For example,
0176 // `"google.api.http"`.
0177 string name = 1;
0178 // The option's value packed in an Any message. If the value is a primitive,
0179 // the corresponding wrapper type defined in google/protobuf/wrappers.proto
0180 // should be used. If the value is an enum, it should be stored as an int32
0181 // value using the google.protobuf.Int32Value type.
0182 Any value = 2;
0183 }
0184
0185 // The syntax in which a protocol buffer element is defined.
0186 enum Syntax {
0187 // Syntax `proto2`.
0188 SYNTAX_PROTO2 = 0;
0189 // Syntax `proto3`.
0190 SYNTAX_PROTO3 = 1;
0191 // Syntax `editions`.
0192 SYNTAX_EDITIONS = 2;
0193 }